ipv6
添加或删除 IPv6。
格式
ipv6 {address | noaddress} <ifname> <address%prefixlen]
说明
[root@sylixos:/root]# help ipv6
add/delete IPv6 address
address [ifname [address%prefixlen]] add an ipv6 address for given interface
noaddress [ifname [address%prefixlen]] delete an ipv6 address for given interface
autocfg [ifname yes | no] enable or disable auto configure for given interface
ipv6 ...
[root@sylixos:/root]#
此命令有 2 种用法:
- 选项address:表示用于给 ifname 添加 IPv6 的地址。
- 选项noaddress:表示用于删除接口中 IPv6 地址。
- %prefixlen:表示网络前缀长度。
样例
[root@sylixos:/root]# ifconfig en1
en1 Link encap: Ethernet HWaddr: 08:09:0a:0b:aa:5a
Dev: dm9000 Ifidx: 2 DHCP: D4 D6 Spd: 100 Mbps
inet addr: 192.168.7.30 netmask: 255.255.255.0
gateway: 192.168.7.1 broadcast: 192.168.7.255
inet6 addr: fe80::a09:aff:fe0b:aa5a Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
collisions:0 txqueue:0 tcpaf:1 tcpwnd:8192
RX ucast packets:0 nucast packets:376 dropped:0
TX ucast packets:0 nucast packets:8 dropped:0
RX bytes:37217 (36.3 KB) TX bytes:580 (580.0 B)
[root@sylixos:/root]# ipv6 address en1 80::d473:8fd4:249c:ba%14
[root@sylixos:/root]# ifconfig en1
en1 Link encap: Ethernet HWaddr: 08:09:0a:0b:aa:5a
Dev: dm9000 Ifidx: 2 DHCP: D4 D6 Spd: 100 Mbps
inet addr: 192.168.7.30 netmask: 255.255.255.0
gateway: 192.168.7.1 broadcast: 192.168.7.255
inet6 addr: fe80::a09:aff:fe0b:aa5a Scope:Link
inet6 addr: 80::d473:8fd4:249c:ba Scope:Unknown
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
collisions:0 txqueue:0 tcpaf:1 tcpwnd:8192
RX ucast packets:0 nucast packets:376 dropped:0
TX ucast packets:0 nucast packets:13 dropped:0
RX bytes:37217 (36.3 KB) TX bytes:1002 (1002.0 B)
[root@sylixos:/root]# ipv6 noaddress en1 80::d473:8fd4:249c:ba%14
[root@sylixos:/root]# ifconfig en1
en1 Link encap: Ethernet HWaddr: 08:09:0a:0b:aa:5a
Dev: dm9000 Ifidx: 2 DHCP: D4 D6 Spd: 100 Mbps
inet addr: 192.168.7.30 netmask: 255.255.255.0
gateway: 192.168.7.1 broadcast: 192.168.7.255
inet6 addr: fe80::a09:aff:fe0b:aa5a Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
collisions:0 txqueue:0 tcpaf:1 tcpwnd:8192
RX ucast packets:0 nucast packets:376 dropped:0
TX ucast packets:0 nucast packets:14 dropped:0
RX bytes:37217 (36.3 KB) TX bytes:1088 (1.0 KB)
[root@sylixos:/root]#