4

I can get the ipv4 address using dhcp,But can't get the ipv6 address.

the dhcp server also support the ipv6 service.
ifconfig eth0

eth0      Link encap:Ethernet  HWaddr: 00:21:85:d3:a3:36  
          inet addr:10.16.31.183  broadcast:10.16.31.255  netmask:255.255.255.0
          inet6 addr: fe80::221:85ff:fed3:a336/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

Other configurations about ipv6:

$ cd /proc/sys/net/ipv6/conf/all
$ grep "" disable_ipv6 forwarding autoconf 
disable_ipv6:0
forwarding:1
autoconf:1

Is there any solution for solving this problem?

Flimm
  • 44,031
kit.yang
  • 2,182

2 Answers2

3

From the output of ifconfig, it appears that IPv6 is not enabled on that interface.

There's two ways to automatically get IPv6 addresses on a network:

  • Autoconfiguration (common, supported by nearly everything IPv6 compatible), &
  • DHCPv6 (rarer, not supported by Mac OS X, just got easy support in Natty, it required config files before Natty)

Autoconfiguration will automatically get an address from a router running on the network that is running a daemon such as radvd. I would assume that autoconf=1 enables it. However, you cannot do IP forwarding on an interface that you have an autoconfigured address on. So forwarding=1 is probably turning getting addresses via autoconfiguration off.

Azendale
  • 12,021
1

IPv6 addresses are not distributed via DHCP. But you can install radvd which distributes IPv6 addresses and also handles the routing if required. After installing via apt-get install radvd you can find example configuration files in /usr/share/doc/radvd/examples/

Also read /usr/share/doc/radvd/README.Debian.

lhw
  • 127