產業消息

Centos 7中新指令 ip addr

$ ip addr
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: ens192: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:ba:0b:07 brd ff:ff:ff:ff:ff:ff
    inet 163.17.xx.xx/25 brd 163.17.40.127 scope global ens192
       valid_lft forever preferred_lft forever
    inet6 2001:288:5400:0:250:56ff:feba:b07/64 scope global dynamic
       valid_lft 2591718sec preferred_lft 2591718sec
    inet6 fe80::250:56ff:feba:b07/64 scope link
       valid_lft forever preferred_lft forever
$ #查看介面傳輸狀態 -s 是詳細顯示
$ 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
    4400       45       0       0       0       0
    TX: bytes  packets  errors  dropped carrier collsns
    4400       45       0       0       0       0
2: ens192: <broadcast,multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 00:50:56:ba:0b:07 brd ff:ff:ff:ff:ff:ff
    RX: bytes  packets  errors  dropped overrun mcast
    207938930  2541628  0       1809366 0       495
    TX: bytes  packets  errors  dropped carrier collsns
    788417     8512     0       0       0       0
$ #查看介面傳輸狀態 -s 是詳細顯示
$ 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: ens192: <broadcast,multicast,up,lower_up> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000
    link/ether 00:50:56:ba:0b:07 brd ff:ff:ff:ff:ff:ff
 
 
連線觀察工具,新的指令ss
$ #TCP listen
$ ss -lt
$ #UDP listen
$ ss -ul
$ #TCP 連線
$ ss -t
 
ip -route
$ #route table
$ ip route
$ #route6 IPv6的route table
$ ip -6 rou
 
介面開關
$ ip l set eth1 up 
$ ip l set eth1 down
 

Centos7 的ifconfig和netstat