How to set Gateway to a Static IP address on host ?

Discussions related to using VirtualBox on Windows hosts.
Post Reply
Vaako
Posts: 4
Joined: 11. Mar 2019, 19:54

How to set Gateway to a Static IP address on host ?

Post by Vaako »

Hi,

I was wondering if someone knows how to set a Gateway to a Static IP address ?

Example:
Host IP address is: 192.168.1.40
Sub Mask: 255.255.255.0
Gateway: 192.168.1.5
DNS: 1.1.1.1

The gateway is a VPN Gateway and I realy like to use that instead of the router gateway.

Any help is welcome.
Regards, Vaako
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: How to set Gateway to a Static IP address on host ?

Post by BillG »

That has nothing whatever to do with VirtualBox. It is done through the OS. How are you setting the static IP? Isn't there an option to set the gateway address as well?
Bill
Vaako
Posts: 4
Joined: 11. Mar 2019, 19:54

Re: How to set Gateway to a Static IP address on host ?

Post by Vaako »

BillG wrote:That has nothing whatever to do with VirtualBox. It is done through the OS. How are you setting the static IP? Isn't there an option to set the gateway address as well?
Yes, in the OS I can set static IP sub.mask and gateway and dns.
I have set the gateway so that it use my VPN-Gateway and normaly my internet traffic goes thru the VPN-Gateway and my public ISP IP number is not vissable.
However if I check my public IP address it seems that my traffic goes not thru the VPN-Gateway: 192.168.1.5

Any thoughts ?
Regards, Vaako
Vaako
Posts: 4
Joined: 11. Mar 2019, 19:54

Re: How to set Gateway to a Static IP address on host ?

Post by Vaako »

I think the best thing to achieve this is using a secondary ethernet port so the OS has it's own physical interface.

Today I ordered a Linksys Gigabit USB to Ethernet Adapter and wil report here if it was successfull or not.
Regards, Vaako
Vaako
Posts: 4
Joined: 11. Mar 2019, 19:54

Re: How to set Gateway to a Static IP address on host ?

Post by Vaako »

I have use a Linksys USB3GIGV1 USB-to-Ethernet adapter and set it in windows with a static IP and the desired gateway.
In VM manager sellect this NIC and in your VM set again the same NIC settings and voila I'm surfing thru my VPN-Gateway.
Regards, Vaako
Post Reply