问题解决了,CentOS7网卡命名比较奇怪,网线接的是服务器第一个网口,我以为对应的是 enp3s0f0 ,就对enp3s0f0的配置文件 ifcfg-enp3s0f0 做了修改,但实际上服务器第一个网口对应的是 enp4s0f0。早晨看了下 RX packets 才发现这个问题,然后对 ifcfg-enp4s0f0 做了修改就好了。。
[root@localhost ~]# ifconfig
enp3s0f0: flags=4099 mtu 1500
ether 1c:c1:de:f2:50:e4 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xfea60000-fea7ffff
enp3s0f1: flags=4099 mtu 1500
ether 1c:c1:de:f2:50:e5 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xfeae0000-feafffff
enp4s0f0: flags=4163 mtu 1500
inet 192.168.1.50 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::1ec1:deff:fef2:d0da prefixlen 64 scopeid 0x20
ether 1c:c1:de:f2:d0:da txqueuelen 1000 (Ethernet)
RX packets 21192 bytes 1327223 (1.2 MiB)
RX errors 0 dropped 120 overruns 0 frame 0
TX packets 434 bytes 59658 (58.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xfeb60000-feb7ffff
enp4s0f1: flags=4099 mtu 1500
ether 1c:c1:de:f2:d0:db txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device memory 0xfebe0000-febfffff
lo: flags=73 mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10
loop txqueuelen 0 (Local Loopback)
RX packets 932 bytes 80948 (79.0 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 932 bytes 80948 (79.0 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099 mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:d4:8e:74 txqueuelen 0 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]#
【 在 winer632 的大作中提到: 】
: 装了CentOS7,给奇怪的网卡名配置了局域网IP192.168.1.50,子网掩码255.255.255.0和网关192.168.1.1。
: 接上网线,发现无法Ping通网关。但是用笔记本电脑配置局域网地址再接上同样的网线就可以Ping通网关。这是何故?CentOS7有什么特殊的设置吗?