how to add a new gateway to an existing network card to access virtual box

Xen list at xenhideout.nl
Fri Mar 10 07:11:59 UTC 2017


robert rottermann schreef op 10-03-2017 6:22:
> hi there
> 
> I have a ubuntu 16.04 running on a remote server, for which I have a
> fixed address assigned by the provider.
> 
> on this machine I have a virtual box virtual server running with a
> static address of 192.168.0.104
> 
> how do I add a gateway to access this address. it needs to be
> accessible only on the remote server. not from the internet.

In general though you don't need to give it a gateway, you just need to 
be part of the same subnet.

In general in a running system you can simply do:

ip addr add 192.168.0.1/24 dev <whatever the virtual device is that 
virtualbox has given you>

In general you can also simply add addresses to your main internet 
device, whatever it is.

You don't actually need any "routing" the kernel will know to send 
packages for a certain IP out a certain device. It doesn't require any 
gateways; adding yourself to that subnet would automatically set up the 
required routes.

To make it persistent depends on what network solution you are using, I 
can't comment on that.

Regards.




More information about the ubuntu-users mailing list