在 CentOS 7 中所不见的命令 : ifconfig、route、netstat、traceroute
从centos6转移到centos7后,发现几个常用的命令找不到,此篇记录在CentOS 6 中所常用的几个工具将被淘汰,并且替代的工具
ifconfig 替换为ip addr
#同ifconfig $ 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: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000 link/ether 00:22:4d:80:7f:6a brd ff:ff:ff:ff:ff:ff inet 192.168.10.10/24 brd 222.186.42.255 scope global enp1s0 valid_lft forever preferred_lft forever inet6 fe80::222:4dff:fe80:7f6a/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 0 0 0 0 0 0 TX: bytes packets errors dropped carrier collsns 0 0 0 0 0 0 2: enp1s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP mode DEFAULT qlen 1000 link/ether 00:22:4d:80:7f:6a brd ff:ff:ff:ff:ff:ff RX: bytes packets errors dropped overrun mcast 26232302 55435 0 0 0 0 TX: bytes packets errors dropped carrier collsns 1338484 14020 0 0 0 0
netstat 替换为ss
#同netstat -tunpl $ ss -tunpl #检视tcp连线 $ ss -t #检视udp $ ss -u
traceroute/traceroute6 替换为tracepath
$ tracepath 8.8.8.8
route 替换为ip route
$ ip route 192.168.10.0/24 dev eth0 proto kernel scope link src 192.168.121.10 169.254.0.0/16 dev eth0 scope link metric 1003 default via 192.168.10.254 dev eth0
arp 替换为ip neighbor
$ ip neighbor 192.168.10.108 dev eth0 lladdr e0:ac:cb:66:2a:3c STALE 192.168.10.254 dev eth0 lladdr 10:7b:ef:47:ce:53 REACHABLE
在CentOS 7 被淘汰的工具只是不在预设安装所包含的,所以是可以利用yum 把他安装回来
Note:在yum 中不知道套件的名称,可以用 provides 和list 直接搜寻package 里面的工具
$ yum provides */ifconfig net-tools-1.60-110.el6_2.x86_64 : Basic networking tools Repo : base Matched from: Filename : /sbin/ifconfig
阅读剩余
版权声明:
作者:yunweiadmin
链接:https://ldnmp.com/centos-7-new-command/
文章版权归作者所有,未经允许请勿转载。
THE END