man page: show / manipulate routing,deviceslinux命令大全, policy routing and tunnels
格式:
ip [ OPTIONS ] OBJECT { COMMAND | help }
命令格式:
ip a # 或者 ip addr
ip -4 a # Only show TCP/IP IPv4
ip -6 a # Only show TCP/IP IPv6
#following only show etho info
ip a show eth0
ip a list eth0
ip a show dev eth0
ip link ls up # Only show runing interfaces
示例:
[jiangjian@localhost shell]$ ip a #或者 ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens33: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 00:0c:29:17:4a:8d brd ff:ff:ff:ff:ff:ff
inet 192.168.119.90/24 brd 192.168.119.255 scope global noprefixroute ens33
valid_lft forever preferred_lft forever
inet6 fe80::f1fb:43f:7ada:57a4/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default qlen 1000
link/ether 52:54:00:ac:bd:ce brd ff:ff:ff:ff:ff:ff
inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
valid_lft forever preferred_lft forever
4: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN group default qlen 1000
link/ether 52:54:00:ac:bd:ce brd ff:ff:ff:ff:ff:ff
[jiangjian@localhost shell]$
上一个教程:linux脚本加入延时等待
下一个教程:【linux命令if】