这是新安装的 CentOS 8.0 的一个非常奇怪的问题,我使用 nmcli 配置了静态 IP,本质上是使用 NetworkManager。所以关闭它不是一个选择,因为我想遵循 RedHat 管理系统的标准方式。
以下是一些信息:
#ping google.com
ping: google.com: Name or service not known
/etc/sysconfig/network-scripts/ifcfg-enp14s0 的内容
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=none
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp14s0
UUID=d64e6ca1-c30d-41ea-a4bb-49445d89aac4
DEVICE=enp14s0
ONBOOT=yes
IPADDR=18.25.16.249
GATEWAY=18.1.0.1
PREFIX=19
DNS1=18.0.70.160
DNS2=18.0.72.3
猫/etc/resolv.conf
# Generated by NetworkManager
nameserver 18.0.70.160
nameserver 18.0.72.3
知识产权
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
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: enp14s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether 2c:fd:a1:c6:d6:a5 brd ff:ff:ff:ff:ff:ff
inet 18.25.16.249/19 brd 18.25.31.255 scope global noprefixroute enp14s0
valid_lft forever preferred_lft forever
inet6 fe80::9864:a2af:89e8:e78d/64 scope link noprefixroute
valid_lft forever preferred_lft forever
3: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
link/ether 2c:fd:a1:c6:d6:a4 brd ff:ff:ff:ff:ff:ff
直接 ping 任何 IP 都可以 ping 172.217.7.14
PING 172.217.7.14 (172.217.7.14) 56(84) bytes of data.
64 bytes from 172.217.7.14: icmp_seq=1 ttl=54 time=6.30 ms
64 bytes from 172.217.7.14: icmp_seq=2 ttl=54 time=6.30 ms
64 bytes from 172.217.7.14: icmp_seq=3 ttl=54 time=6.30 ms
64 bytes from 172.217.7.14: icmp_seq=4 ttl=54 time=5.82 ms
我已经重新启动并停止了 NetworkManger,但还是不行。DHCP 可以工作,但我需要静态 IP。这是怎么回事?