how to configure static ipv6 and additional ipv6 with same vlan?

joseph-shin asked:

I’m having trouble with configuration static ipv6 address and additonal ipv6 on same interface(eth4).

  1. static ipv6 configuraiton issue

firstly, I configure below

vi /etc/network/interfaces

auto eth4
iface eth4 inet6 static
address 0.0.0.0
network 0.0.0.0

auto eth4.484
iface eth4.484 inet6 static
address 2028:2123:1015:1015::aa11
netmask 2028:2123:1015:1015::/64
up route add -host 2027:2123:1015:1015::aa21 gw 2028:2123:1015:1015::aa10 dev eth4.484

auto eth4.484:1
iface eth4.484:1 inet6 static
address 2028:2123:1015:1015::aa12
netmask 2028:2123:1015:1015::/64

and I hit the ifconfig -a

eth4      Link encap:Ethernet  HWaddr 00:0C:29:CF:E6:76  
          inet6 addr: fe80::20c:29ff:fecf:e676/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:54 errors:0 dropped:27 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4168 (4.0 KiB)  TX bytes:2120 (2.0 KiB)

eth4.484  Link encap:Ethernet  HWaddr 00:0C:29:CF:E6:76  
          inet6 addr: 2028:2123:1015:1015::aa12/0 Scope:Global
          inet6 addr: 2028:2123:1015:1015:20c:29ff:fecf:e676/64 Scope:Global
          inet6 addr: fe80::20c:29ff:fecf:e676/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:2032 (1.9 KiB)  TX bytes:1652 (1.6 KiB)

so, to use static ipv6 I added also like below but it doesn’t work.

/etc/sysctl.conf

net.ipv6.conf.eth4.484.accept_ra=0
  1. how to configure secondary static ipv6 in the same interface(eth4)

I want to add static ipv6 address (2028:2123:1015:1015::aa12) in the eth4 as well, but don’t know how, because I need to use two source ip with same vlan for specific destination ip address.

Any suggestion would be much appreciated.

My answer:


Your interfaces file has a bunch of problems in it.

First, netmask isn’t specified properly. Second, you’re using the old way of aliasing, which doesn’t really work anymore, and especially not with VLANs. Third, your route statement also uses the old style. Unfortunately, all of these are actually recommended in Debian’s wiki and hundreds of old, outdated tutorials on the Internet.

The relevant parts of your file should look something like this:

auto eth4.484
iface eth4.484 inet6 static
        address 2028:2123:1015:1015::aa11
        netmask 64
        up ip -6 route add to 2027:2123:1015:1015::aa21 via 2028:2123:1015:1015::aa10 dev eth4.484

iface eth4.484 inet6 static
        address 2028:2123:1015:1015::aa12
        netmask 64

Note also that you’re missing a gateway address. You need to specify this as well, or the gateway given by SLAAC will be used instead. Or you just won’t be able to talk to any hosts except the one you set up a static route for.


View the full question and answer on Server Fault.

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.