1. Press the win+R key, type in it: hdwwiz, and then click "OK"
2. Keep clicking Next until the page as shown in the figure appears. Select the network adapter and click Next
3. Click Microsoft, select Microssoft KM-TEST adapter, click Next, Next, and then click Finish
4. Configure the static IP address of the loopback network card (the following figure shows Ethernet 3 as an example)
-
Right click and click properties
-
Select Internet Protocol version 4, click Properties
-
172.16.51.100 is the IP address of the windows loopback network card. 172.16.51.1 is the address of the Linux server.
5. Open the virtual machine, select "Edit" -> "Virtual Network Editor", make sure to "bridge to" the Microsoft KM-TEST loopback adapter.
6. Use the bridge mode to configure the IP address of Linux, assuming that the first network card is used to bridge
7. Then use the Linux command line to open the configuration file of the first network card /etc/sysconfig/network-scripts/ifcfg-ens33
command:
[root@localhost ~]# vim /etc/sysconfig/network-scripts/ifcfg-ens33
After opening, the vim text is modified as follows:
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
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=ens33
UUID=1cc353ed-bbed-4e29-96d2-2a6dbe770e8c
DEVICE=ens33
ONBOOT=yes
IPADDR=172.16.51.1
NETMASK=255.255.255.0
~
~
~
~
~
:wq!
8. Restart the network card ens33, and test whether the network is connected under Linux. If the packet loss is equal to 0%, the network is connected.
command:
[root@localhost ~]# ifdown ens33
[root@localhost ~]# ifup ens33
连接已成功激活(D-Bus 活动路径:/org/freedesktop/NetworkManager/ActiveConnection/4)
[root@localhost ~]# ifconfig ens33
ens33: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 172.16.51.1 netmask 255.255.255.0 broadcast 172.16.51.255
inet6 fe80::44fd:2d29:4ff2:97ec prefixlen 64 scopeid 0x20<link>
ether 00:0c:29:a0:78:bf txqueuelen 1000 (Ethernet)
RX packets 550 bytes 35229 (34.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 54 bytes 8018 (7.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@localhost ~]# ping 172.16.51.100 -c4
PING 172.16.51.100 (172.16.51.100) 56(84) bytes of data.
64 bytes from 172.16.51.100: icmp_seq=1 ttl=128 time=0.193 ms
64 bytes from 172.16.51.100: icmp_seq=2 ttl=128 time=0.414 ms
64 bytes from 172.16.51.100: icmp_seq=3 ttl=128 time=0.432 ms
64 bytes from 172.16.51.100: icmp_seq=4 ttl=128 time=0.621 ms
--- 172.16.51.100 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3002ms
rtt min/avg/max/mdev = 0.193/0.415/0.621/0.151 ms