如何configuration静态ipv6和额外的ipv6与相同的VLAN?

我在configuration静态ipv6地址和在同一接口(eth4)上增加ipv6时遇到了麻烦。

  1. 静态ipv6configuration问题

首先,我在下面configuration

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 

我打了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) 

所以,使用静态ipv6我也添加如下,但它不起作用。

/etc/sysctl.conf中

 net.ipv6.conf.eth4.484.accept_ra=0 
  1. 如何在同一接口(eth4)configuration二级静态ipv6

我想在eth4中添加静态ipv6地址(2028:2123:1015:1015 :: aa12),但是不知道怎么做,因为我需要使用两个具有相同vlan的源ip作为特定的目的ip地址。

任何build议将不胜感激。

你的interfaces文件中有一堆的问题。

首先, netmask没有正确指定。 其次,你正在使用旧的混叠方式,这实际上不再有效,特别是不适用于VLAN。 第三,你的路线声明也使用旧的风格。 不幸的是,所有这些实际上都是在Debian的维基以及因特网上数百个过时的教程中推荐的。

你的文件的相关部分应该是这样的:

 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 

还要注意,你缺less一个gateway地址。 您也需要指定,否则将使用由SLAAC提供的网关。 或者你只是不能和任何主机通话,除了你设置一个静态路由。