I just want to apologize right-off-the-bat for this discussion/question because talking about this topic seems to upset everyone even though many seem to do this setup all the time.
I like to use a VM as my main router in my home. Let me clearly…
-
Ubuntu (Host) with 2 NIC’s - one setup as a WAN going directly to the cable modem, and the other setup as the LAN line going to a wireless 4 port router/switch in bridge mode.
-
Host - Running Virtualbox with one VM (Vyos - router) acting has the router for the whole setup.
-
The host and the Bridged router/switch have static IP address.
Ok, so now that we have that out of the way let me talk a little about what is going on. First I need to mention that I do have the vyos router routing traffic from LAN to WAN, and computers setup with DHCP, and static IP’s are getting internet through the WAN. So it is working.
In Virtualbox I have given the VM (vyos) 4 NIC’s eth0-eth3. Eth0 is bridged to the hosts NIC that is connected to the modem and the other 3 VM NIC’s are bridged to the NIC that is acting as the LAN going to the wireless switch in bridge mode. Vyos is getting internet access through the WAN using DHCP (eth0), and the LAN IP is set to 192.168.2.1/24 (eth1). I have setup Vyos to serve IP address’s from 192.168.2.10 - 192.168.2.254 over the 192,168.2.0/24 network including the DNS server, and seems to be working. I have also setup a NAT rule connecting 192.168.2.0/24 to the WAN interface and all computers can get on the internet.
The problem is with my two static connections - 192.168.2.2 (router/switch in bridge mode) and 192.168.2.3 (Host). They don’t seem to be getting served DNS. If I set the DNS to something outside my network like 8.8.8.8 then it works, but if I set it to the default gateway (192.168.2.1) than it does not work/connect. I have used my default gateway to resolve DNS before with out any problem. I am unsure what I need to setup to get this working in vyos.
This is where people seem to get mad/upset for some reason even though a lot of them do this - The host is getting its connection through the VM. Sorry, but this is a good setup and I have ran it successfully before. Its not a problem if you start your router from your host not in headless. I don’t like running headless and only want to connect to my router from the Host’s Desktop, and yes I did say DESKTOP. I like having a desktop on my host because it is easier to deal with files and my host also runs a file server.
Now that, that’s out of the way… Once I am able to get this fully configured I would like to setup static networks of 192.168.3.1/32 on eth2, and 192.168.4.1/32 on eth3 both NATed to the WAN. 192.168.3.2 will be for PS4 (1) and 192.168.4.2 will hopefully also be able to go through the wifi a long with the 192.168.2.0/24 network so I can use it for my other PS4, but if not I will just use that address for my Host. One of the reasons I would like to do this is so I can port forward both PS4’s on the same port for gaming. (If this wont work let me know)
Any thoughts, changes or help with the DNS problem would be great. Keep in mind that I am NOT a network admin with lots of knowledge, and I don’t want to buy anything else. I have some Linux command line knowledge, but not anything super below the surface. I have a wireless 4 port router/switch, and a computer with 2 motherboard NIC’s running NON-ECC ram. And remember I want to control the router from my host desktop.
Also, if anyone has any good routing rules for gaming that would be a great help.
Thanks for your understanding and help.