As this is the forum to talk about implementing new functions, I'm a bit stuck on both the design AND implementation. I have been writing ethernet drivers that can be tested in QEMU, VMware VS2, and VirtualBox-OSE. I now want to make a gateway for the host OS so that when the user of the host tries to access the internet it has to pass through the VM first. This would allow me to use the VM (with a custom OS) to filter packets for easy testing.
My current setups use a ethernet bridge (br0 for VirtualBox) or a tap/tun (tun0) device (in QEMU). I can't figure out how to connect the host to "one side' and have the "other side" connected to the real gateway (router). Any ideas?
VM Gateway
VM Gateway
Website: https://joscor.com
Re: VM Gateway
I would try to do just the same as with real hardware. The VM gets two NICs, say tap0 for local connections and tap1 for the real network. In the host you would put tap1 and eth0 into the same bridge, so the VM is connected to the internet. The default route needs to be changed from eth0 to tap0, so all IP packets of the host go to the VM first.
I won't guarantee that this actually works though.
I won't guarantee that this actually works though.