RHEL7查看网卡配置命令ip addr show

Validating Network Address Configuration  

To verify the configuration of the network address, you need to use the  ip  utility. The  ip  utility is a modern utility that can consider advanced networking features that have been introduced recently. With the  ip  utility, many aspects of networking can be monitored:    
■   Use  ip addr  to configure and monitor network addresses    
■   Use  ip route  to configure and monitor routing information    
■   Use  ip link  to configure and monitor network link state
To show current network settings, you can use the  ip addr show  command (which can be abbreviated as  ip a s  or even as  ip a ). The  ip  command is relatively smart and does not always require you to type the complete option.--RHEL7.0版本以上查看网络配置命令使用ip addr show,以前的命令ifconfig -a不再使用了。

[root@rhel7 ~]# ifconfig -a
-bash: ifconfig: command not found
[root@rhel7 ~]# ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> 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 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:d8:65:0a brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.111/24 brd 192.168.1.255 scope global enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fed8:650a/64 scope link 
       valid_lft forever preferred_lft forever
[root@rhel7 ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> 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 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:d8:65:0a brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.111/24 brd 192.168.1.255 scope global enp0s3
       valid_lft forever preferred_lft forever
    inet6 fe80::a00:27ff:fed8:650a/64 scope link 
       valid_lft forever preferred_lft forever
[root@rhel7 ~]# ip route
default via 192.168.1.100 dev enp0s3  proto static  metric 100 
192.168.1.0/24 dev enp0s3  proto kernel  scope link  src 192.168.1.111  metric 100 
[root@rhel7 ~]# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 08:00:27:d8:65:0a brd ff:ff:ff:ff:ff:ff
[root@rhel7 ~]# 

ip -s link:  This shows all existing network connections, in addition to statistics about the number of packets that have been sent and associated error messages.   

[root@rhel7 ~]# ip -s link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    RX: bytes  packets  errors  dropped overrun mcast   
    688        8        0       0       0       0       
    TX: bytes  packets  errors  dropped carrier collsns 
    688        8        0       0       0       0       
2: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 08:00:27:d8:65:0a brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast   
    225404     2550     0       0       0       0       
    TX: bytes  packets  errors  dropped carrier collsns 
    199788     1327     0       0       0       0       
[root@rhel7 ~]# 

 

posted on 2016-06-24 16:17  遠離塵世の方舟  阅读(12398)  评论(0编辑  收藏  举报

导航