LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Strange Linux Network Question (https://www.linuxquestions.org/questions/linux-newbie-8/strange-linux-network-question-4175598682/)

danmartinj 01-31-2017 09:28 PM

Strange Linux Network Question
 
Hello,

I do not really consider myself a newbie anymore when it comes to Linux however there are some weird things going on with my little test environment that I cannot fully explain and I was hoping someone here might have some feedback as it is annoying and time consuming to deal with.

I have a test environment with one linux laptop that connects wirelessly to my VMs on my other laptop so basically it looks like the below network design.

Laptop 1 --> VM1 --> VM2 --> VM3

The VMs are using Virtualbox internal networks. Anyhow, no matter how I setup my routes on the VMs Laptop 1 can only send traffic to the other VMs if the other VMs first connect to Laptop 1 first. It is almost like the VMs tell the Laptop 1 what the routes are going to be.

Anyhow, hopefully I have made this problem clear enough and maybe someone has some ideas why I am seeing this behavior? I tried setting up routes every way I could think of and I even turned off network manager on Laptop 1 but nothing seems to work.

Thanks,
Joe

frankbell 01-31-2017 09:40 PM

More information would be useful. These questions come immediately to mind:

Just to clarify, the VMs are on Laptop 2, but are somehow connecting through Laptop 1?

In the VirtualBox settings for the VMs, are you using a "bridged" adapter or some other setting?

How are the routes on the VMs laptop to which you refer set up?

ericson007 02-01-2017 12:10 AM

Sounds like your system is using nat. In that case on laptop 2, you would have to enable port forwarding and has to forward conections to each vm.

I always find it easiest to create virtual networks and bridge them with physical adapters or pass a physical adapter directly to a vm. The later not really being a consideration for a laptop though.

That being said, if you can show us the networking options virtual box gives you and your current config. That would be nice.

I never tried virtual box for these things as kvm gives me everything i could want, but i am sure there must be similarities in terms of network setup.

Jjanel 02-01-2017 01:01 AM

Here's a link that helped me fathom the tricks of VBox internal vs. bridged:
http://www.dedoimedo.com/computers/v...k-sharing.html (&VBox doc)

I thought that 'internal' kept it all *within one PC* (Laptop 2[?]),
but I've heard of tricks where -like- Laptop1 won't -broadcast- arp request
(depending on its routing table: netstat -rn) but learns when it hears...
(look at / maybe post before&after: arp -a) p.s. myBlogFYI nictrace->.pcap!

danmartinj 02-01-2017 01:19 PM

Just to clarify.
All VMs are on laptop 2
My laptop(1) ----- connects -- VM1 ----------- VM2 ----------- VM3 --------------- VM4 (target node)
(Uses Wifi ) (bridged) (internal 1) (internal 2) (internal 3)
192.168.1.0/24 172.20.1.0/24 10.100.0.0/16 192.168.3.0/24



I have used KVM before but I don't have a lot of experience and with virtual box I find to be more intuitive and more cross-platform as my laptop is mac and I always assumed KVM was meant more for linux which I could be wrong.

Hopefully the diagram makes more sense. Like I said as long as I first ping first from my VMs to laptop 1 then laptop 1 can ping back.
I find it strange I have to first ping from VM2, VM3 and VM4 to get my laptop 1 to send packets to VM1. On my laptop 1 the default route is set to VM1 which is in bridged mode.

Thanks again for your help...its a simple fix but I find it annoying and time consuming to first ping from all my VMs to the laptop to get it to connect or see my other VMs.

R
Joe

ericson007 02-01-2017 04:28 PM

That sounds like pf interfering. But here is an interesting link i found,

http://apple.stackexchange.com/quest...10-10-yosemite

It may get your foot in the door. Sorry. I have 0 experience on mac.

But yeah kvm is linux only.

The short of that article says not to use bridge but rather setup a bridge adapter.

danmartinj 02-03-2017 04:26 PM

ericson007,

Thanks for the reply back, it was an interesting read. As far as I can tell I still have the problem. However, as annoying as it is I feel I can just deal with it using scripts to just ping from the other VMs and just basically automate the ping until "if" I need to upgrade my test environment I will look into it again.

Thanks again for the help,

Joe

ericson007 02-03-2017 06:54 PM

One last thing. Did you set your main computer that host the machines' Interface card to promiscious mode?


All times are GMT -5. The time now is 02:52 AM.