0

There are two network cards in my workstation. One for our local network and one for internet access.

The local network card has static ip address 192.168.1.10 with gateway of 192.168.1.1.

The internet network card has static ip 192.168.155.* with gateway of 192.168.155.1.

Now I use the route to make the pc access local network and internte at the sametime.

route ADD     0.0.0.0 MASK 255.255.255.0  192.168.155.1 # default use the internet network card 
route ADD 192.168.1.0 MASK 255.255.255.0  192.168.1.1   # for local network

It worked.

However I have VirtualBox installed, and there is a guest vm with bridge network with static ip 192.168.1.11. I can not access that after I set the route.

Is it possbile to make the host and guest can access each other, also make the guest vm can access both local and internet?


update:

Before I set the route, my virtualbox guest vm works as expected, so I think there is not problem with the configuration with the vbox.

migrated from serverfault.com Sep 22 '16 at 6:35

This question came from our site for system and network administrators.

  • You have a typo in your first line. Should be 192.168.1.1 for the gateway. At least according to your route. Does the gateway know about the 1.11 address? In that case it shouldn't be a problem? – Seth Sep 22 '16 at 7:21
  • Sorry, that's a typo. The 1.11 is a virtualbox guest, I am not sure if the gateway can identify that. – ubuntu Sep 22 '16 at 7:42
  • If it does it should work. Your traffic would get from your workstation to the gateway and back to your workstation. Make sure the VM has a route/configuration that sets up the gateway. If you're running it in bridged mode there are two devices next to each other, in a way. An other option might be to setup a route with a metric for the 1.11 address that is lower than the general 1.0 route. – Seth Sep 22 '16 at 7:50
  • See my update. Also I have tried the metric, it does not work. – ubuntu Sep 22 '16 at 8:20
  • Your route tells your computer to redirect any traffic it has for 192.168.1.0/24 to 192.168.1.1. What did you try for the metric and which route did you add for it? What doesn't work if you don't setup those routes? – Seth Sep 22 '16 at 9:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.