Two ways for VirtualBox to let the host connect to the VPN through the virtual machine

method one:

1. The network adopts WIFI connection, the network connection method adopts " bridge network card ", the host IP is 192.168.0.105, the default gateway is 192.168.0.1, the virtual machine IP is set to 192.168.0.145, and the default gateway is the same as the host ;

 

2. Turn off the firewall of the virtual machine , connect to the VPN and open CCProxy, select the IP as 192.168.0.145, add port 1521 of port mapping 192.168.138.11 to port 1521 of the virtual machine, and select TCP as the port type ;

 

3. The host successfully accesses port 1521 of 192.168.0.145!

 

Method Two:

1. The network is directly connected by a network cable, and the network connection method is " Network Address Translation (NAT) ". Different from method 1, there is no need to set the IP and default gateway of the virtual machine, but it is necessary to configure " port forwarding " and select "TCP" as the protocol. ”, fill in 1521 for both the host port and the subsystem port, and leave the IP blank ;

 

2. Turn off the firewall of the virtual machine , connect to the VPN and open CCProxy, select the IP as the IP before the virtual machine is not connected to the VPN, add port 1521 of port mapping 192.168.138.11 to port 1521 of the virtual machine, and select TCP for the port type ;

 

3. The host successfully accesses port 1521 of 127.0.0.1!

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326550576&siteId=291194637