![为 Ubuntu VM 提供服务的 CentOS 主机](https://linux22.com/image/1485440/%E4%B8%BA%20Ubuntu%20VM%20%E6%8F%90%E4%BE%9B%E6%9C%8D%E5%8A%A1%E7%9A%84%20CentOS%20%E4%B8%BB%E6%9C%BA.png)
需要一些帮助通过 Virtual-Box 的桥接选项将 CentOS NIC(物理)桥接到 Ubuntu VM。
CentOS 7 在代理(http/https)环境后面的 UCS 上运行。尝试通过该接口进行桥接,以便 VM 和物理接口可以位于同一子网中。(我希望物理 NIC 充当交换机)。
CentOS 主机和 Ubuntu VM 可以互相 ping 通。但无法 ssh 进入 Ubuntu VM,Ubuntu VM 也无法 ping 默认网关。
我尝试在下面发布尽可能多的相关信息。一如既往地感谢。
“/etc/sysctl” 文件
centos-2 ~]# cat /etc/sysctl.conf
# System default settings live in /usr/lib/sysctl.d/00-system.conf.
# To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file
#
# For more information, see sysctl.conf(5) and sysctl.d(5).
net.ipv4.ip_forward = 1
“ifconfig-主机”
centos-2 ~]# ifconfig
enp1s0f0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.27.255.85 netmask 255.255.255.0 broadcast 172.27.255.255
“ifconfig-虚拟机”
ubuntu ~]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.27.255.158 netmask 255.255.255.0 broadcast 172.27.255.255
“我可以 ping 通”
centos-2 ~]# ping 172.27.255.158
PING 172.27.255.158 (172.27.255.158) 56(84) bytes of data.
64 bytes from 172.27.255.158: icmp_seq=1 ttl=64 time=0.705 ms
64 bytes from 172.27.255.158: icmp_seq=2 ttl=64 time=0.314 ms
ubuntu ~]# ping 172.27.255.85
PING 172.27.255.85 (172.27.255.85) 56(84) bytes of data.
64 bytes from 172.27.255.85: icmp_seq=1 ttl=64 time=0.605 ms
64 bytes from 172.27.255.85: icmp_seq=2 ttl=64 time=0.914 ms