Most firewalls randomize ports (rewrite the source port) of outbound traffic. This is problematic for some protocols (like PPTP, IPSEC and SIP). sipXbridge needs static port NAT, or symmetric signalling in order to work properly. This means when sipXbridge makes an media connection at port 30001, it must be sent out on port 30001 (not rewritten by the firewall), and also come back on the same port. This is done by choosing “Firewall>NAT>Outbound” and selecting “Manual (AON)”. I’ve tried to make it easy by providing a sample setup which can be edited in a word process or (like Wordpad) and uploading to the system.
A friend of mine helped me to get this implemented, and so I thought I’d share.
After doing a basic install of pfSense, login to the webgui and go to “Diagnostics>Backup and Restore”. Do a backup and open the config.xml in wordpad or other basic text editor. Then grab this file and do a find/replace to match your settings ( IP addresses, etc.). After that, restore the new config file to your system.
Find and replace commands:
- Domain name – mydomain.com with your domain name like example.com
- DNS – Change 18.104.22.168 and 22.214.171.124 to some of your own liking that will work with your ISP.
- pfSense Webgui – I have it set for https on port 10443, change it to something you want, but remember stay away from: 80,8443, 5060-5080, 30000-31000.
- LAN IP – I have pfsense here on 192.168.2.1, I also have sipXecs at 192.168.2.10. Change these as needed to suit your needs, don’t forget to match your mask.
I think if you properly do a find/replace on your IP’s/mask/gw’s it should be fairly straightforward.
After restoring, you should go to the CLI and reset the password, which will be “pfsense”, then go to SYSTEM>PACKAGES>INSTALLED and remove any that are there.
This pfSense config does not include vlans or traffic shaping, and is a basic config. More complex use cases might be coming later, but that’s it for now. Hope to post a complete step-by-step how-to on the sipx-wiki.
Here’s a basic step-by-step guide to getting pfSense installed:
If you need a VMWARE image, go www.pfsense.org and grab the vmware image. In the meantime, if you are installing on an standalone PC, use this ISO image. After installing the VMWARE Image, you should remove any installed packages and install the VMTOOLS package (to get timesync correct, and set you correct timezone (ex: America/New_York).
First step, install a Video card, Keyboard, a CD-ROM drive, an IDE hard Disk drive, 128MB of ram or more and at least two Network interfaces in your target machine. Do not install any unnecessary hardware like a modem because Pfsense cannot use it.
The hardware setup for the installation tested was Pentium Pro 200, 128MB EDO ram, Floppy 1.4MB, Trident VGA, 4 Realtek 8139D PCI cards, ATAPI CD_ROM 24X, 2 IDE 1GB drives. As you can see it was quite an old system but it all still worked quite well. Pfsense was also installed on a DELL Dimension 4100 800MHz without any problems.
Next, take the downloaded ISO file and burn the CD as an ISO (not a file copy).
Set up your BIOS to boot from the CD and then insert the CD into the drive. Reboot the machine and watch the FreeBSD 6.2 operating system boot up your machine. Do not worry if you cannot catch everything that is scrolling by because you can see all of it when the boot is complete by pressing the Scroll LOCK on your keyboard and using the Page UP/DN keys. The boot process should stop and ask you to configure the network interfaces. If you managed to make that far the rest of the installation, most likely, will be successful.
Answer no to the first prompt asking to setup Virtual Interface/Lan by typing n.
Now it will ask you to select the LAN interface. This is the interface that you will attach to an Ethernet switch if more than one computer will be accessing the pfsense to get to the internet. To select this interface use the automatic procedure by disconnecting all interface cables from all the network interfaces of the pfsense. Follow the instructions on the screen and then attach the computer via an Ethernet cable to the LAN port. Mark this interface as the LAN interface.
Next it will ask you to select the WAN port. If you have not set up your DSL/CABLE modem/routers yet select an interface by specifying the name of the interface as shown on the display. This interface can be changed later on.
Pfsense will start to load and configure itself. With a little luck, you will pass the point where pfsense configures the WAN interface. This is where the interrupts are tested and if your hardware is set up properly, or if you have a newer computer, it will breeze through and arrive at the Pfsense Console Setup page. Here you will install pfsense to your hard disk by entering 99. If you do not make it to this page you have a hardware compatibility problem with the FreeBSD operating system.
Installation is pretty painless, tell it to format and make a new partition if you want everything cleaned off, and once complete you’ll see FreeBSD loading. The loading will take some time .
At the CLI you will have an option to set the LAN IP address, go ahead and make sure you can connect to that IP with a web browser from a PC on the LAN. Now run through the wizard and set a password, etc. In Diagnostics, go to grab a backup (config.xml) and start putting your password, ip/mask/gateways and domain name into the one posted here and do the restore.
Remember to use a port for pfSense to connect to (the example we’ve provided is 10443 as https) and connect to it after the restore has occurred.
Coming Up – Setting Up Example siptrunk with ITSP Bandwidth.com via sipXbridge! Soon afterwards, traffic shaping for sipXecs and pfSense!