ifconfig 與 ip 指令的替代關係
ifconfig
--------
eth0 Link encap:Ethernet HWaddr 08:00:27:83:0B:8D
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
RX packets:45 errors:0 dropped:0 overruns:0 frame:0
TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
ifconfig eth0:0 192.168.56.201/24
ip
-------
[root@localhost ~]# ip address
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:83:0b:8d brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
RX: bytes packets errors dropped overrun mcast
9626 92 0 0 0 0
ip address add 192.168.56.201/24 dev eth0 label eth0:0
--------
- 看 ip,直接下不用帶參數
eth0 Link encap:Ethernet HWaddr 08:00:27:83:0B:8D
inet addr:10.0.2.15 Bcast:10.0.2.255 Mask:255.255.255.0
- 看封包狀況,直接看,不用帶參數
RX packets:45 errors:0 dropped:0 overruns:0 frame:0
TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
- 設定臨時 IP
ifconfig eth0:0 192.168.56.201/24
ip
-------
- 看 ip,參數 address
[root@localhost ~]# ip address
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:83:0b:8d brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
- 看封包狀況,用參數 -s link
RX: bytes packets errors dropped overrun mcast
9626 92 0 0 0 0
- 設定臨時 IP
ip address add 192.168.56.201/24 dev eth0 label eth0:0
留言
張貼留言