-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Louis Lagendijk wrote:
On Wed, 2009-06-10 at 13:08 -0500, Vadtec wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
A few months back, I tried to use the network scripts to provision an IPv6 range like can be done with IPv4. I was using CentOS 5.2 at the time and was informed that 5.2 was broken in this regard. I have upgraded to CentOS 5.3 now and I am trying to get IPv6 to provision an entire range of IPs, but I am still getting the old behavior and no IPs are being provisioned.
I have been following the docs provided by the link in the /etc/sysconfig/network-scripts/ifup-ipv6 at http://www.deepspace6.net/projects/initscripts-ipv6.html#id2801589 and using the following configs:
/etc/sysconfig/network NETWORKING=yes GATEWAY=***.***.***.*** GATEWAYDEV=eth0 HOSTNAME=vadtec
NETWORKING_IPV6=yes IPV6FORWARDING=no IPV6_AUTOCONF=no IPV6_AUTOTUNNEL=no IPV6_DEFAULTDEV=eth0:1 IPV6_DEFAULTGW=2001:0470:0103:001A::1
/etc/sysconfig/network-scripts/ifcfg-eth0-1
Why do you need an alias device here? Put the ipv6 config on the eth0 device,and add the configuration to the ifcfg-eth0 file
DEVICE=eth0:1 IPV6INIT=yes IPV6ADDR=2001:0470:0103:001A:0001:0000:0000:0000:/96
You are allocating a /96 with all 0 in the last 32 bits. So you are not allocating an address. Why a /96? Using a /64 is pretty much the standard for ipv6.
IPV6_AUTOCONF=no IPV6_ROUTER=no IPV6FORWARDING=no ONBOOT=no
When I run service network restart, it doesn't even provision the default IPv6 GW on eth0:1, nor does eth0:1 even show up.
I must admit I never tried an v6 address on an alias, so I have no clue whether it works or not. But you can have both v4 and v6 addresses next to each other on the eth0 device
If I run tail /var/log/boot.log, boot.log is empty. If I run tail /var/log/messages, I see varying amounts of:
Jun 10 11:42:14 localhost kernel: [208192.884652] eth0: duplicate address detected!
Probably due to the all 0 in the part AFTER the /96
I see no other errors or messages saying anything is wrong or otherwise.
Autoconfiguration is the way to go if you want to make it easy. On my server I set the addresses manually like DEVICE=eth0.159 ONBOOT=yes BOOTPROTO=none NETMASK=255.255.255.0 HWADDR=00:1a:92:d6:99:91 IPADDR=192.168.159.1 #GATEWAY=192.168.178.1 TYPE=Ethernet USERCTL=no IPV6INIT=yes IPV6FORWARDING="yes" # v6 address changed to protect the innocent IPV6ADDR="2001:888:118e:18a2::1/64" PEERDNS=no VLAN=yes Please not that I am using vlans, hence the .159 on the eth0. Normally you do not need that and you leave the VLAN=yes off. Please note the ::1 at the end of the address. I use radvd on that machine (so here I need to set fixed v6 addresses), but the clients do not neede that:
DEVICE=eth0 BOOTPROTO=none DNS1=192.168.159.1 IPADDR=192.168.159.3 NETMASK=255.255.255.0 HWADDR=00:11:d8:be:98:fa ONBOOT=yes SEARCH="pheasant" USERCTL=no PEERDNS=no IPV6INIT=yes NM_CONTROLLED=yes GATEWAY=192.168.159.1 TYPE=Ethernet
Here the address is set depending on the (/64) prefix received from the radvd server.....
kind regards, Louis
CentOS mailing list CentOS@centos.org http://lists.centos.org/mailman/listinfo/centos
Thanks for the tip about having all zeros at the end of the IP. I figured the script would go ahead and provision the IPs anyways. The reason I was using a /96 is because the machine happens to be a VPS with only 128MB of RAM, so I figured the less IPs I provision the less memory it will take up, which is limitted anyways. I also do not want to use radvd or auto configuration because I do not need to broadcast or forward ipv6 on this vps.
As per your suggestions, I removed the extra zeros and changed the prefix to /64.
I am now using the following configs:
/etc/sysconfig/network: NETWORKING=yes GATEWAY=67.202.107.1 GATEWAYDEV=eth0 HOSTNAME=vadtec
NETWORKING_IPV6=yes IPV6FORWARDING=no IPV6_AUTOCONF=no IPV6_AUTOTUNNEL=no IPV6_DEFAULTDEV=eth0 IPV6_DEFAULTGW="2001:0470:0103:001A::1"
/etc/sysconfig/network-scripts/ifcfg-eth0: DEVICE=eth0 IPADDR=***.***.***.*** NETMASK=255.255.255.0 BROADCAST=***.***.***.*** ONBOOT=yes
IPV6INIT=yes IPV6ADDR="2001:0470:0103:001A::2/64" IPV6_AUTOCONF=no IPV6_ROUTER=no IPV6FORWARDING=no PEERDNS=no VLAN=no
However, this is not provisioning an entire range as follows:
eth0 Link encap:Ethernet HWaddr 00:16:3E:70:FC:96 inet addr:***.***.***.*** Bcast:***.***.***.*** Mask:255.255.255.0 inet6 addr: 2001:470:103:1a::2/64 Scope:Global inet6 addr: fe80::216:3eff:fe70:fc96/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:70 errors:0 dropped:0 overruns:0 frame:0 TX packets:29 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:6738 (6.5 KiB) TX bytes:2050 (2.0 KiB)
I also have a large number of "unreachable" routes shown on the local loopback when I do ip -6 route show: unreachable ::/96 dev lo metric 1024 error -101 mtu 16436 advmss 16376 hoplimit 4294967295 unreachable ::ffff:0.0.0.0/96 dev lo metric 1024 error -101 mtu 16436 advmss 16376 hoplimit 4294967295 unreachable 2002:a00::/24 dev lo metric 1024 error -101 mtu 16436 advmss 16376 hoplimit 4294967295 unreachable 2002:7f00::/24 dev lo metric 1024 error -101 mtu 16436 advmss 16376 hoplimit 4294967295 unreachable 2002:a9fe::/32 dev lo metric 1024 error -101 mtu 16436 advmss 16376 hoplimit 4294967295 unreachable 2002:ac10::/28 dev lo metric 1024 error -101 mtu 16436 advmss 16376 hoplimit 4294967295 unreachable 2002:c0a8::/32 dev lo metric 1024 error -101 mtu 16436 advmss 16376 hoplimit 4294967295 unreachable 2002:e000::/19 dev lo metric 1024 error -101 mtu 16436 advmss 16376 hoplimit 4294967295 unreachable 3ffe:ffff::/32 dev lo metric 1024 error -101 mtu 16436 advmss 16376 hoplimit 4294967295
I assume those are something to do with how IPv6 works, but I'm not sure.
So, back to my original question, I have it provisioning *one* IP, how do I get it to provision a *range* of IPs. As I said above, this is a VPS that does not need to broadcast any of its IPs or forward IPv6. I just need to be able to provision a range of IPv6.
Thanks for the help so far!
Vadtec vadtec@vadtec.net