1. 程式人生 > >思科路由器上實測ipv6地址

思科路由器上實測ipv6地址

#沒有配置ipv6地址的介面
r1#sh run int fa1/0
interface FastEthernet1/0
 ip address 172.16.12.1 255.255.255.0           
 duplex auto
 speed auto
end
r1#sh ipv6 int bri
FastEthernet1/0            [up/up]
    unassigned
FastEthernet1/1            [administratively down/down]
    unassigned

r1(config)#int fa1/0
r1(config-if)#ipv6 addr ?


  WORD                General prefix name
  X:X:X:X::X          IPv6 link-local address
  X:X:X:X::X/<0-128>  IPv6 prefix
  autoconfig          Obtain address using autoconfiguration
#配置本地鏈路地址不成功,因為ipv6的link-local地址必須是fe80::/16開頭的
r1(config-if)#ipv6 addr 3333::1 link-local
% Invalid link-local address
#先配置ipv6 prefix地址

r1(config-if)#ipv6 addr 3333::1/112     
r1(config-if)#do sh run int fa1/0
interface FastEthernet1/0
 ip address 172.16.12.1 255.255.255.0
 duplex auto
 speed auto
 ipv6 address 3333::1/112

#配置了prefix地址後,會自動配置link-local
r1#sh ipv6 int bri
FastEthernet1/0            [up/up]
    FE80::C800:14FF:FE38:1C
    3333::1
FastEthernet1/1            [administratively down/down]
    unassigned

#可以手動配置link-local,覆蓋掉自動生成的link-local
#一個介面只能有一個link-local,配置多條前面的會被覆蓋
#一個介面可配置多條prefix地址

r1(config-if)#ipv6 addr fe80::1 link-local
r1(config-if)#ipv6 addr fe80::1:1 link-local
r1(config-if)#ipv6 addr fe80::3:1:1 link-local

r1(config-if)#ipv6 addr 4444::1/112     

r1#sh int fa1/0
interface FastEthernet1/0
 ip address 172.16.12.1 255.255.255.0
 duplex auto
 speed auto
 ipv6 address 3333::1/112
 ipv6 address 4444::1/112
 ipv6 address FE80::3:1:1 link-local
end