How to configure Trixbox for remote phones by a complete novice.

Although I am a computer programmer by trade, I am a complete novice when it comes to Linux and this Trixbox application. I've spend the better part of three weeks getting this system setup, working with all types of computers, phones, connections and the like.

One of the hardest things I've had to figure out was the ability to take a phone, plug it in at home and connect to the server at the office. I'm happy to report that I have created this complete step by step guide to help those of you in this same situation. Hopefully by following these steps, although not perfect, you too can get your Trixbox Remote SIP phones working within minutes instead of weeks like myself.

OK, let's begin.

PHASE 1: Gathering some basic intel

One of the first things you will need to do is determine if you trixbox will be behind a router/firewall or if it will have a straight connection to the internet. Personally I feel more comfortable knowing that my box is behind a firewall, so I'm going to write this as if the box is behind a firewall.

The next part is to setup your Trixbox so it's on a STATIC IP address on your network instead of a dynamic IP. This is important because later we will have to forward some ports to this IP address. If you don't know your IP or you need to set yours to a Static IP, I would suggest looking at the WIKI posted by SureTeq to see how this is done. Write down your IP address as we will be referencing this quite often. When I need you to write in your Trixbox IP, I will use the label [TrixBox IP]. Got it? Good!

Now that we have your trixbox IP, let's talk about your internet IP. If you have a Status WAN IP for your internet, then write that down and go on to the next paragraph. If your internet access is on a Dynamic IP like a DSL or Cable Modem, then you will need to sign up for a free Dynamic DNS (DDNS) service with someone like DynDNS, No-IP or some other sites. A good trick is to log into your Router/Firewall and see if they support DDNS services and setup an account with one of them. Once you have your DDNS name setup, write it down and let's go to the next phase. Just like above, I will reference this by using the label [WANIP] for either the static IP or the DDNS name.

PHASE 2: Configuring your Router/Firewall

We now have to configure your Router/Firewall by opening up some ports call Port Forwarding or Application Hosting. Each manufacture like Linksys, DLink, Netgear all can do this but I can't show you how to do all of them. Therefore if you are unfamiliar with how to configure your router, then give this information to your IT Consultants and have them do it for you.

One of the major keys to making remote phones work is poking holes in your firewall to allow these remote connections to get to your Trixbox. Specifically, you need to foward the following ports. Ready?

Name Type Start Port End Port IP
SIP UDP 5060 5072 [TrixBox IP]
IAX2 UDP 4569 4569 [TrixBox IP]
MM UDP 10001 20000 [TrixBox IP]

Some of you may be saying, why 10001 and not 10000? This is because there is an addon application in Trixbox that uses 10000 so I'd rather be safe than sorry.

PHASE 3: Configuring Trixbox

OK, now the fun begins! Most likely you've already done the top two phases and your phones still don't work. I should know, I was stuck at this point for almost a week myself!

What we have to do is configure TrixBox so it knows how to handle itself behind a firewall. This is easily done by modifying two files in Asterisks:

sip_nat.conf
rtp.conf

The easiest way to do this is directly through Trixbox. So bring up your favorite internet explorer and log into your Trixbox. Now click on Switch and switch to the maintenance mode. Click on Asterisk-]Config Edit. At this point you should see a list of files on the left hand side. Look for rtp.conf and click on it.

Now in the notepad field above you should see some data. Look for the following:

rtpstart=10000

Now change the value from 10000 to 10001. Now click on Update and the bottom to save it.

Look for /etc/asterisk and click on that. Now again on the left hand side look for sip_nat.conf and click on it. This should bring you to a blank screen.

Before we can enter in anything here, we need to create some new labels so we can plug in these values in the box above. The two new labels are as follows:

[LocalNet]: This is the first three blocks of your [Trixbox IP] plus .0 at the end. So if your trixbox is on 192.168.1.5, then your LocalSub will be 192.168.1.0
[LocalSubnet]: This is the subnet of your network, usually 255.255.255.0 but if you don't know then ask your network manager.

Remember above when I had you write down your Internet IP address either as the IP address or the DDNS name? This is where it's going to be used. Now the instructions for a static IP is different from a dynamic IP so read carefully.

Enter in the following information for your type of connection. DO NOT ENTER IN BOTH AS THAT WILL ONLY CONFUSE TRIXBOX. ONLY ENTER IN THE COMMANDS FOR YOUR INTERNET TYPE. Also don't forget to substitue the labels for the actual values. For example don't enter in [WANIP] by instead entering in 99.54.124.225.

THIS IS YOUR LAST WARNING....

Static IP
---------
externip=[WANIP]
localnet=[LocalNet]/[LocalSubNet]

Dynamic IP
-------------
externhost=[WANIP]
externrefresh=28800
localnet=[LocalNet]/LocalSubNet]

Now save this file by clicking Update.

PHASE 4: Pay the man!

Believe it or not, that's it! Go ahead and restart your TrixBox and your remote phones should work. Just remember, on your remote phones you will enter in either the [WanIP] as your proxy so it knows how to contact your trixbox server behind the firewall.

Hopefully this is useful to you. If it is, then please help me by sending me a PayPal donation. You can get my paypal userid by clicking on my name above and shotting me a quick message.