Hi.
I have a network configured like this:
Wifi Router: 192.168.1.1
PC A (Linux): 192.168.1.10 - connected to router via Ethernet
PC H (HOST - Windows 10): 192.168.1.11 - connected to router via WiFi
- PC G (VirtualBox GUEST - Linux) - configured bridged adapter with host's wifi adapter - 192.168.1.20
Then I installed nginx server to PC G to test this, I turned off firewalls. On PC A I type 192.168.1.20 into browser -> I see nginx welcome page. I can see packets flowing in wireshark running in PC G (guest).
So far so good! That's what I wanted
The problem: I want to route traffic for some IPs through PC G (Guest)
I added routing rules for specific IPs to the Router. I added
Dest: 10.0.0.0 Mask: 255.0.0.0 GW: 192.168.1.20 Enabled
Now when I type 10.1.1.1 on PC A, I can see correct packets (source IP 192.168.1.10; dest IP 10.1.1.1) flowing in Wireshark running on PC H (host, 192.168.1.11) but not in Wireshark running in PC G (Guest, 192.168.1.20) - which is strange.
I am not sure if this is some configuration problem, which seem unlikely for me, but networking isn't my bread, or Windows problem or VirtualBox problem. Or maybe a router problem? Tp-link TL-WDR4300. Should I try to install ddwrt on the router and try it then?
Thanks.
Regards
G.
[SOLVED] Routing to guest's bridged adapter
[SOLVED] Routing to guest's bridged adapter
Last edited by gloomyens on 5. Apr 2020, 22:52, edited 1 time in total.
-
BillG
- Volunteer
- Posts: 5106
- Joined: 19. Sep 2009, 04:44
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 10,7 and earlier
- Location: Sydney, Australia
Re: Routing to guest's bridged adapter
A router has no way of telling whether a device is a vm, a pc, a radio or a refrigerator. All it sees is addresses. I have never seen any routing problem which was caused by the device being a vm. For a few years I used virtual networks and vms bridged to physical networks to test some quite complex networking setups. They always behaved exactly the same way as physical machines and networks. If you have problems with simple LAN-to-LAN routing I would look elsewhere for the cause, not suspect a vm problem.
I am not familiar with nginx, but Windows Server and pfSense work as expected in any vm I have used as a router.
I am not familiar with nginx, but Windows Server and pfSense work as expected in any vm I have used as a router.
Bill
Re: Routing to guest's bridged adapter
Thank you for the answer.
The problem was caused by setting "promiscuous mode" which was set to Deny.
Actually, problem was that this setting can be changed while the VM is running, but it probably doesn't take effect.
When I shut down the machine, changed "promiscuous mode" setting to "Allow All" and boot again it worked as expected.
Looks like this is only problem on Wifi. With ethernet cable it worked with both "promiscuous mode" options.
The problem was caused by setting "promiscuous mode" which was set to Deny.
Actually, problem was that this setting can be changed while the VM is running, but it probably doesn't take effect.
When I shut down the machine, changed "promiscuous mode" setting to "Allow All" and boot again it worked as expected.
Looks like this is only problem on Wifi. With ethernet cable it worked with both "promiscuous mode" options.