Centos 7
[root@localhost ~]# ifconfig
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::9169:54b:c56:a3aa prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:26:0a:91 txqueuelen 1000 (Ethernet)
RX packets 304 bytes 27572 (26.9 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 749 bytes 71715 (70.0 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 68 bytes 5912 (5.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 68 bytes 5912 (5.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:d1:e9:ea 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
[root@localhost ~]#



設(shè)置VMware虛擬網(wǎng)卡中的網(wǎng)關(guān)IP

ncpa.cpl中虛擬網(wǎng)卡的配置,不需要配置網(wǎng)關(guān)

VMnet1的地址要與物理網(wǎng)卡屬于同一網(wǎng)段,


在windows防火墻里開(kāi)啟放行

開(kāi)啟任何ip的放行

這個(gè)好像是對(duì)的

=============================================
驗(yàn)證
=============================================
虛擬機(jī)可以同物理機(jī)
[yyf@localhost ~]$
[yyf@localhost ~]$
[yyf@localhost ~]$ su - root
密碼:
上一次登錄:日 11月 20 21:39:37 PST 2022從 gatewaypts/2 上
[root@localhost ~]#
[root@localhost ~]#
[root@localhost ~]# ping 192.168.1.129
PING 192.168.1.129 (192.168.1.129) 56(84) bytes of data.
64 bytes from 192.168.1.129: icmp_seq=1 ttl=128 time=0.316 ms
64 bytes from 192.168.1.129: icmp_seq=2 ttl=128 time=0.295 ms
64 bytes from 192.168.1.129: icmp_seq=3 ttl=128 time=0.132 ms
64 bytes from 192.168.1.129: icmp_seq=4 ttl=128 time=0.239 ms
^C
--- 192.168.1.129 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 0.132/0.245/0.316/0.073 ms
[root@localhost ~]#
主機(jī)也可以ping通虛擬機(jī)
C:\Users\Administrator>
C:\Users\Administrator>ping 192.168.1.100
正在 Ping 192.168.1.100 具有 32 字節(jié)的數(shù)據(jù):
來(lái)自 192.168.1.100 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64
來(lái)自 192.168.1.100 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64
來(lái)自 192.168.1.100 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64
來(lái)自 192.168.1.100 的回復(fù): 字節(jié)=32 時(shí)間<1ms TTL=64
192.168.1.100 的 Ping 統(tǒng)計(jì)信息:
數(shù)據(jù)包: 已發(fā)送 = 4,已接收 = 4,丟失 = 0 (0% 丟失),
往返行程的估計(jì)時(shí)間(以毫秒為單位):
最短 = 0ms,最長(zhǎng) = 0ms,平均 = 0ms
C:\Users\Administrator>