Help on how to setup pfsense as a wireless AP/FW/router in virtual box
-
Do they have DNS? Have you tried pinging the ip of a google server like:
ping 8.8.8.8(I know its simple and you probably already did the simple checks)
-
Hi kejianshi,
Many thanks for the reply. No, I wouldn't assume I have done a good job at trouble shooting. Routing and network has been one of my many weaknesses and I have not been exposed to pfsense until few weeks ago. I am at most a pro-sumer.
Regarding DNS servers settings, using OpenDNS, I have tried the following:
- setting it up at pfsense:System:General Setup:DNS Servers: 208.67.222.222, gateway=none
- setting it up at the client (e.g. Windows:IPv4 Properties:General:Preferred DNS server addresses:208.67.222.222)
The results are the same. The LAN:bridge0 interface offered a valid IP address but gave a time-out when I ping www.google.com. No internet traffic gets through. The OPT1:192.168.22.x interface just works.
As a side note, before I bridged, on OPT2:Wlan0 offered a valid IP through its DNS server. I can't connect to the internet but when I ping www.google.com, I would get:
PING www.google.com (74.125.128.147) 56(84) bytes of data.
timeout…..So it did a bit better as www.google.com was resolved to a valid external IP address, but then got stuck somewhere.
Unfortunately, every time I try to bring wlan0 to an interface, it seems to cause problems exchanging traffic to the outside world.
I thought about bridging the eth1 and wlan0 on Wheezy first before passing it as one interface (say br0) to pfsense through virtual box. However, even if it works, it's less than ideal because it is one less interface pfsense can manage and further reduces the role pfsense can play in this set up, I think...
-
I'm pausing because I'm wondering if there isn't a better way to do what you are trying to do with the hardware you have in hand. I have a habit of NOT virtualizing pfsense unless its unavoidable and going ahead and virtualizing everything else. I've just had less headaches that way.
If every OS and every client I had was running in a VM, pfsense is the one thing I'd try to keep on hardware.
But I don't know how much hardware you have or how many client OS you must support.That said, I do see people here talk of some success with virtual box.
My feeling is that if you want a pfsense VM to be able act as router for some other VMs on the same physical box, thats easy enough. But when you start trying to get pfsense to ALSO act as router to some external physical machines or wifi APs, I really start thinking you need a different hypervisor than virtual box. Something that can take exclusive control of physical NICs and hand it over to pfsense. (I'm no virtual box expert though).
I think v-sphere might do a much better job when you start talking about pfsense needing to manage a mix of virtual and physical clients.
-
Hi kejianshi,
Thanks again for this. This full size computer used to be my linux server for printing, mail, ftp, ldap, simple routing (as a dual stack (IPv6/IPV4) router connected with a switch), web, cloud storage and media center but I re-purposed it in favor of a lower power mini ITX setup. So I am really just experimenting and trying to push things a bit of how far things can go.
I wanted to pursue this route because I felt it is a flexible/easily scalable implementation. I used to have routers running DD-WRT and hacked them to do all/some of the above but I ended up with many special purpose network devices and it became very cumbersome to manage. It also became more expensive from a hardware and learning point of view as I found myself having to learn many different slightly different systems. Performance also suffered because none of these boxes can give me real time data encryption quite like a current generation desktop cpu running say linux when moving large files through SATA or USB3.0 connected hard drives.
As such, I want to replace as many physical devices using VMs as possible. I understand keeping pfsense (router) separate is superior because my network will not go down along with my computer but at this point I am willing to make the trade off. The VMs make it very easy to backup and restore.
Back on topic, to answer your question, I intend to connect less than 10 devices (including TVs, game consoles, etc) to this setup, if I get it to work without breaking things too much.
I feel I am getting quite close. pfsense is already talking to the two physical NICs and the virtual network. The problem really is with wlan0 which is "translated" by virtualbox as just another wired NIC to pfsense, and pfsense has already managed to assign IPs to machines that are connected to this interface (bridged or unbridged). I feel that I am just missing something obvious to get internet working due to inexperience… haha.. As I have time, I will continue to experiment with it and try to learn a bit more about virtual machines and pfsense.
Failing everything, one option is to buy a simple wireless switch to connect to my LAN facing NIC. I need to get more ports anyway. I will also look at v-sphere. I know nothing about it at this point.
BTW, would you have any good suggestions if I want to learn how to analyze and trouble shoot network problems as a beginner? Should I learn how to analyze packets to trouble shoot things such as this?
-
Ohhhh.
Ummmmm…. Google? -
"I will also look at v-sphere."
So this box id going to be your VM host? Then yeah I would run esxi (vsphere) over virtualbox for sure!!
As to your wifi issue - just get a wireless router and use it as AP, any wireless router will do… Don't you have one laying around? What did you do for your router before?
I run my whole network off a VM pfsense on esxi box.. Router on vm for your physical network works great, there is little reason not to do it if you ask me.. And would be the 1st thing I would visualize not the last ;)
The LAN nic on my isxi host is connected to my physical switches, and both real and vms have access to the internet through pfsense vm. I also have wlan on its own segment where pfsense is firewall between wlan segment and lan and internet and even a dmz segment that is vm access only through pfsense.
-
Minus the difference of opinion about virtual vs physical firewall, if you are already running pfsense in vsphere to manage both virtual and physical clients, you would probably be the perfect person to walk hching through it.
I MIGHT even consider doing it at 1 location because no one is there to fix anything if something should break so I do have an interest in running the least amount of hardware possible. (Its the middle of nowhere)
-
Sure happy to walk you through it
Here is a basic diagram of how it would be setup in the most basic mode - 2 nics in your physical host. 1 to your internet (wan) other to physical lan (lan).
You could clearly get fancier with it - break out your vmkern port group to its own phy nic. More nics in the host could allow you to breakout your wlan to its own physical segment, dmz or other firewalled segments.
Or you could also use vlans to run your different segments between vm and phy over just 1 physical nic. Inside the host you could add as many vswitches or portgroups to breakout vlans, etc.
Other pic is my current vswitches in my esxi host. See how pfsense is tied to wan, lan, wlan and dmz.
-
So much more sane than virtual box.
-
Virtualbox is more for running a VM on your PC to test something, etc. I would not use it for setup like this. Its great if you want to fire up another copy of windows or linux to test something or run some questionable code or visit a questionable site, etc.
You could set it up to work sure - but its much easier in something like esxi, which is FREE as well.
-
I do plan to set up pretty much exactly what you have laid out here in at least one place. Eventually. Perhaps after a stable release of 2.1 when I will be forced to visit that place again.
-
Oh so your waiting for 2.1 to release before you setup the VM environment.
Not sure what sort of access you have to this location. But if make sure you can access the esxi host.. You could set it up now and then just update to 2.1 final.. If any issues you could correct remotely, etc.
-
No physical access except by long plane ride.