如何通过以太网连接两个 Linux VM?
我在电脑上的 VMware 上安装了两个 Fedora VM。我想通过以太网连接它们,我想执行在它们之间进行 ping,如何一步一步做到这一点?
ifconfig
这里是VM1 上的命令输出:
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet6 fe80::9943:3557:39d9:f25e prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:a3:ea:c4 txqueuelen 1000 (Ethernet)
RX packets 25737 bytes 28917500 (27.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7911 bytes 701863 (685.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 45 bytes 4217 (4.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 45 bytes 4217 (4.1 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# ping 192.168.211.137
connect: Network is unreachable
ifconfig
这里是VM2 上的命令输出:
root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.211.137 netmask 255.255.255.0 broadcast 192.168.211.255
inet6 fe80::dc17:d447:a162:c6b9 prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:4c:57:c8 txqueuelen 1000 (Ethernet)
RX packets 112014 bytes 136116308 (129.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 33494 bytes 2619940 (2.4 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 10282 bytes 918950 (897.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 10282 bytes 918950 (897.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
以下是 VM1 和 VM2 上的网络设置:
正如你所看到的我得到:connect: Network is unreachable