日期:2014-05-16  浏览次数:20790 次

Linux IPv6 address configuration的思考


默认情况下,现在常用的Linux发型版本都支持IPV6,且同时激活。

此时,如果网络中有一个IPV6的网络设备正在执行ND操作,发送RS消息,linux机器自动回应RA消息,同时,该接口使用IPV6的autoconfiguration功能,自行配置上IPV6地址。

如果该Linux interface收到多个网段的IPV6 RS消息,则,同步会配置上多个IPV6地址。

如:

[asr@Fedora-30-103 ~]$ ifconfig
em1       Link encap:Ethernet  HWaddr 00:15:17:8C:43:B8  
          inet addr:10.74.30.103  Bcast:10.74.30.255  Mask:255.255.255.0
          inet6 addr: 10:74:30:0:215:17ff:fe8c:43b8/64 Scope:Global
          inet6 addr: fe80::215:17ff:fe8c:43b8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:470 errors:0 dropped:0 overruns:0 frame:0
          TX packets:275 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:58057 (56.6 KiB)  TX bytes:49415 (48.2 KiB)
          Interrupt:18 Memory:b8820000-b8840000 

em2       Link encap:Ethernet  HWaddr 00:15:17:8C:43:B9  
          inet addr:40.0.0.2  Bcast:40.0.0.255  Mask:255.255.255.0
          inet6 addr: 2003::215:17ff:fe8c:43b9/64 Scope:Global
          inet6 addr: fe80::215:17ff:fe8c:43b9/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19 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:5514 (5.3 KiB)  TX bytes:6355 (6.2 KiB)
          Interrupt:19 Memory:b8800000-b8820000 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:30 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1952 (1.9 KiB)  TX bytes:1952 (1.9 KiB)

p6p1      Link encap:Ethernet  HWaddr 00:15:17:CB:6D:FC  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:16 Memory:b8c60000-b8c80000 

p6p2      Link encap:Ethernet  HWaddr 00:15:17:CB:6D:FD  
          inet addr:9.2.1.1  Bcast:9.2.1.255  Mask:255.255.255.0
          inet6 addr: 2001::215:17ff:fecb:6dfd/64 Scope:Global
          inet6 addr: 2002::215:17ff:fecb:6dfd/64 Scope:Global
          inet6 addr: 2003::215:17ff:fecb:6dfd/64 Scope:Global
          inet6 addr: fe80::215:17ff:fecb:6dfd/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:176 errors:0 dropped:0 overruns:0 frame:0
          TX packets:59 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:23261 (22.7 KiB)  TX bytes:11173 (10.9 KiB)
          Interrupt:17 Memory:b8c20000-b8c40000 

p6p3      Link encap:Ethernet  HWaddr 00:15:17:CB:6D:FE  
          inet addr:5.1.1.11  Bcast:5.1.1.255  Mask:255.255.255.0
          inet6 addr: 2003::215:17ff:fecb:6dfe/64 Scope:Global
          inet6 addr: fe80::215:17ff:fecb:6dfe/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:13 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2613 (2.5 KiB)  TX bytes:5854 (5.7 KiB)
          Interrupt:17 Memory:b8b60000-b8b80000 

p6p4      Link encap:Ethernet  HWaddr 00:15:17:CB:6D:FF  
          inet addr:9.4.1.1  Bcast:9.4.1.255  Mask:255.255.255.0
          inet6 addr: fe80::215:17ff:fecb:6dff/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:22 errors:0 dropped:0 overruns:0 carrier:0
          colli