我已经设置了 CentOS VM,并尝试桥接网络,但不起作用。我花了 3 个多小时尝试在互联网上找到的解决方案,但由于我缺乏这方面的经验,我无法让它工作。
以下是一些信息:
root@desktop internet]# ping 8.8.8.8
connect: Network is unreachable
[root@desktop internet]# ip route
192.168.122.0/24 dev virbr0 proto kernel scope link src 192.168.122.1 linkdown
[root@desktop internet]# cat /etc/sysconfig/network-scripts/ifcfg-ens160
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=eui64
NAME=ens160
UUID=d6564f1e-0165-4ffa-abb7-6f85d368f587
DEVICE=ens160
ONBOOT=yes
IPADDR=143.248.152.195
PREFIX=24
GATEWAY=143.248.152.1
[root@desktop internet]# cat /etc/sysconfig/network-scripts/ifcfg-ens160
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=eui64
NAME=ens160
UUID=d6564f1e-0165-4ffa-abb7-6f85d368f587
DEVICE=ens160
ONBOOT=yes
IPADDR=143.248.152.195
PREFIX=24
GATEWAY=143.248.152.1
[root@desktop internet]# cat /etc/sysconfig/network
# Created by anaconda
[root@desktop internet]# cat /etc/resolv.conf
# Generated by NetworkManager
nameserver 8.8.8.8
nameserver 8.8.4.4