linux ip命令

1、ip网卡信息
ip link list
1: lo: mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 1000
link/ether 00:16:3e:00:04:b5 brd ff:ff:ff:ff:ff:ff
3: eth1: mtu 1500 qdisc pfifo_fast state UNKNOWN mode DEFAULT qlen 1000
link/ether 00:16:3e:00:04:12 brd ff:ff:ff:ff:ff:ff

2、地址信息
ip address show
1: lo: mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:16:3e:00:04:b5 brd ff:ff:ff:ff:ff:ff
inet 10.169.16.154/21 brd 10.169.23.255 scope global eth0
valid_lft forever preferred_lft forever
3: eth1: mtu 1500 qdisc pfifo_fast state UNKNOWN qlen 1000
link/ether 00:16:3e:00:04:12 brd ff:ff:ff:ff:ff:ff
inet 121.42.136.161/22 brd 121.42.139.255 scope global eth1
valid_lft forever preferred_ft forever

3、路由信息
ip route show
default via 121.42.139.247 dev eth1
10.0.0.0/8 via 10.169.23.247 dev eth0
10.169.16.0/21 dev eth0 proto kernel scope link src 10.169.16.154
100.64.0.0/10 via 10.169.23.247 dev eth0
121.42.136.0/22 dev eth1 proto kernel scope link src 121.42.136.161
127.0.0.0/8 dev lo scope link
169.254.0.0/16 dev eth0 scope link
172.16.0.0/12 via 10.169.23.247 dev eth0

4、mac 地址信息
ip neigh show
121.42.139.247 dev eth1 lladdr 00:00:0c:9f:f3:20 REACHABLE
10.169.23.21 dev eth0 lladdr 00:16:3e:00:b3:ff STALE
10.169.23.249 dev eth0 lladdr 00:2a:6a:b6:77:3c STALE
10.169.23.248 dev eth0 lladdr 00:2a:6a:b1:a3:7c STALE
121.42.139.249 dev eth1 lladdr 00:2a:6a:b6:77:3c STALE
10.169.23.247 dev eth0 lladdr 00:00:0c:9f:f2:bc STALE
121.42.139.248 dev eth1 lladdr 00:2a:6a:b1:a3:7c STALE

删除 mac 地址
ip neigh delete 9.3.76.43 dev ethic

5、路由规则
ip rule list
0: from all lookup local
32766: from all lookup main
32767: from all lookup default

first local 、then main、then default。

关于 tc 的信息
http://tldp.org/HOWTO/Traffic-Control-HOWTO/

发表评论

电子邮件地址不会被公开。 必填项已用*标注