VLAN testing lab



  • Hi all

    I'm new to pfSense. I'm doing some testing with it using VirtualBox 5.1.10 on MacOS Sierra (10.12.1).

    I have pfSense installed (guest1) and then 2x lubuntu guests for test clients (guest2 and guest3).

    I want pfSense to be on both vlan1 and vlan2. I then want guest2 on vlan1 and guest3 on vlan2.

    Has any one managed to do this with VirtualBox? Or any other way? I've searched all over but just finding posts where people are wanting to combine it with VLANs on their physical LAN for example. I don't. I just want a virtual network/lab in VirtualBox to test away with pfSense.

    To confirm, this is really about the setup of VirtualBox not pfSense, so I post here in hope some one has done this before and can share some knowledge :)

    Many thanks



  • VLANs need a physical LAN to piggyback on.  In Virtualbox, create your WAN bridged to your NIC, and then create an internal network, eg intnet1 to act as LAN.  Then you create your VLANs and assign them to your LAN NIC.  Any virtual machines like your Lubuntu boxes need to be on intnet1.



  • I already have WAN bridged to my NIC and the 2x lubuntu boxes on 'internal network' as you describe.

    Can you expand on "Then you create your VLANs and assign them to your LAN NIC." please? Do I just have to do this on the lubuntu VMs? Or do you mean do it "for real" on OS X > Network preferences > cog button at the bottom > manage virtual interfaces, and get virtual box to then use those? Sorry for the confusion and thank you for your help.



  • In pfSense, go to Interfaces - (assign).  Then select the VLANs tab and create a VLAN.  Then go back to Interface Assignments and assign OPT1 to the new VLAN.  Then go to Interfaces - OPT1 and enable it then configure it.



  • Please see my last post again sorry. Where am I creating VLANs before hand though? On my host (OS X) or in test vms (lubuntu)? I can see what I need to do in pfSense after but I can not work out where I need to actually create them before.



  • In your test VM.  For linux I think you have to install the vlan package and then configure it like any other adapter.



  • Thank you KOM, that's done it! :)

    DHCP just hangs at the moment (I've set up another DHCP server in pfSense on VLAN2) but if I set it as static on the test VM I can ping pfSense's IP for that VLAN fine. Progress!

    Cheers!


  • LAYER 8 Global Moderator

    How do you have this setup??  How are you wanting to test "vlans"  Is this network traffic going to go over a real physical network via a smart switch that does vlans?

    Or are you just trying to isolate your vms into different networks with pfsense as the router/firewall between the networks?

    If so you don't need to do anything with vlans.. You could just use host only networks on your virtual box.  Can you draw what your wanting to do exactly.



  • He wants a VLAN testing lab as the topic states.  Literally, an environment where he can play with configuring VLANs.


Log in to reply