CentOS 是一个工业标准的 Linux 发行版,是红帽企业版 Linux 的衍生版本。你安装完后马上就可以使用,但是为了更好地使用你的系统,你需要进行一些升级、安装新的软件包、配置特定服务和应用程序等操作。

ifconfig 替换为ip addr

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#同ifconfig 
$ ip addr

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
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

#详细
$ ip -s link

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
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

1
2
3
4
5
6
7
8
#同 netstat -tunpl 
$ ss -tunpl

#檢視tcp連線
$ ss -t

#檢視udp
$ ss -u

traceroute/traceroute6 替換為 tracepath

1
2
$ tracepath 8.8.8.8 

route 替換為 ip route

1
2
3
4
5
$ 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

1
2
3
$ 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 裡面的工具

1
2
3
4
5
6
$ yum provides */ifconfig 

net-tools-1.60-110.el6_2.x86_64 : Basic networking tools
Repo : base
Matched from:
Filename : /sbin/ifconfig