ifconfig
命令格式
ifconfig
[-a]
<_interface_\> <_address_\> [netmask
[hw ether ] [mtu
[inet6 add ]
[inet6 del ]
[up|down]
表 1 参数说明
使用指南
- 命令需要启动TCP/IP协议栈后才能使用。
- 由于IP冲突检测需要反应时间,每次使用ifconfig设置IP后会有2S左右的延时。
- ifconfig eth0 192.168.100.31 netmask 255.255.255.0 gateway 192.168.100.1 hw ether 00:49:cb:6c:a1:31
- ifconfig eth0 inet6 add 2001:a:b:c:d:e:f:d
- ifconfig eth0 inet6 del 2001:a:b:c:d:e:f:d