1

So I have recently started making a router and other things that I haven't decided yet out of an old computer I had lying around. It has 2 NIC's. It is running Ubuntu 17.04 and VirtualBox.

Currently my only VM is PfSense. I want to know what network settings I need in VirtualBox so I can have one NIC be only accessable as the WAN to PfSense, the Other NIC be the LAN of PfSense, and finally I want the host (Ubuntu) and all other VM's to have internet access through the LAN of PfSense

Owen Chiu
  • 13
  • 2

1 Answers1

0

Haven't done this myself, but I'm mostly sure this will work. Disable the WAN NIC on your Ubuntu system, iface <interface> inet manual in the /etc/network/interfaces file, (it shouldn't need address info) and then ifdown <interface> it. This will prevent the Ubuntu machine from using it to access the internet. In VirtualBox, the pfSense VM will need to have two NIC cards installed in Bridged Mode. This should allow it access to both NICs, (the WAN won't have an IP address but the bridging should allow it full access to the card). From here you can do your LAN DHCP or use static IP addresses and the NIC on the WAN should get its IP from the router or use a static IP as well. Release and renew all of your LAN IP addresses so that they know to use the pfSense VM as a gateway. Done.


EDIT: I missed a bit of your question, so here's some more. You can either set all of the VMs to use bridged mode on the LAN and have them access pfSense that way, (not recommended since it will use up a lot of resources). Or you can add a third adapter on the pfSense VM that is set to Internal Network, and set your VMs to use Internal Network as well. Using Internal Network removes the need for the hardware NIC to be accessed and all networking access will be virtualized, which should be faster since it's not waiting on hardware. Have pfSense route all of the traffic from the LAN and Internal Network to each other if you want the LAN and VMs to access each other.

Blerg
  • 1,202
  • 7
  • 17
  • That fulfills the first 2 parts of my question, leaving the last part of giving other VM's access to the LAN provided by the PfSense VM. I am confused on how to do this because PfSense will only provide LAN access to one NIC, so I am pretty sure that I can't have a third network adapter setup in VirtualBox as an Internal Network. – Owen Chiu Jul 08 '17 at 21:09
  • Sorry about that, totally missed that part. Updated my answer. – Blerg Jul 08 '17 at 22:22
  • Thanks for the edit. Do you know how I would have PfSense route traffic from the LAN and the Internal Network to each other? – Owen Chiu Jul 09 '17 at 01:57
  • I think bridging the interfaces is what you'll want to do to get them working. You can find out more information on this [here](https://www.cyberciti.biz/faq/how-to-pfsense-configure-network-interface-as-a-bridge-network-switch/). That looks like what you need to communicate between the ports. – Blerg Jul 09 '17 at 03:09
  • Thanks for the answer, I forgot about the optional interfaces in PfSense. – Owen Chiu Jul 09 '17 at 19:03