multiple IPv6 addresses in /etc/network/interfaces

Jimmy Stewpot mailers at oranged.to
Wed Feb 10 01:40:16 UTC 2010


Hello,

I currently have a production system which we manage remotely. We have the existing configuration running with both IPv4 and IPv6 address space configured. All has been working well for some time. Unfortunately we need to deploy an additional IPv6 address which is persistent across reboots. Currently we have the second address being added using an ifconfig line. Is there any way to automate the additional addresses using /etc/network/interface without doing post/pre up stuff? Like we do with IPv4 below?


cat /etc/network/interfaces

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
        address 1.1.1.1
        netmask 255.255.255.0
        network 1.1.1.0
        broadcast 1.1.1.255
        gateway 1.1.1.254
        post-up /sbin/iptables-restore < /etc/iptables/rules
        post-up /sbin/ip6tables-restore < /etc/iptables/rules6

iface eth0 inet6 static
        address <IPv6_address_here>
        netmask 56
        post-up /sbin/ifconfig eth0 inet6 add <IPv6_address_here>
        post-up /sbin/iptables-restore < /etc/iptables/rules
        post-up /sbin/ip6tables-restore < /etc/iptables/rules6

auto eth0:0
iface eth0:0 inet static
        address 2.2.2.181
        netmask 255.255.255.255
        post-up /sbin/iptables-restore < /etc/iptables/rules
        post-up /sbin/ip6tables-restore < /etc/iptables/rules6

It just feels like its a little bit of a hack rather than some sort of standard way of doign IPv6.. Any advice would be greatly appreciated.

Regards,

Jimmy Stewpot.




More information about the ubuntu-server mailing list