Migrating to Asterisk VoIP PBX - Part 3
Continueing on from where Part 2 left off, this post will be mostly filled with configuration information used throughout our infrastructure getting it getting for Asterisk.
I left off Part 2 talking about my TFTPd modification that allows me to execture arbitrary commands when a file is requested from my TFTPd server, to explain the rule mentioned in my previous post.
x ^00085D /usr/local/bin/mkaastracfg
the ‘x’ means this is an ‘execute rule’, this is what my patch added. the ‘^00085D’ is the pattern to match, the Aastra phones request a config file named <MAC>.cfg, that 00085D is the OUI prefix for the Aastra phones. Then as you can see it executes my mkaastracfg program, the filename being requested gets passed to mkaastra config as a command line argument, this is how the program collects all the configuration data. The only extra step here is configuring your DHCP server to set option ‘66′ (boot-server) to the IP address of your TFTPd server. If you are using ISC DHCPd you just need to add the following line to your scope.
option tftp-server-name “10.1.0.10″;
This now essentially allowed us to create devices and assign default users to devices inside FreePBX, then plug a brand new right out of the box phone into one of our PoE ports the phone boots up our TFTPd dynamically creates its configuration file when it boots and thats it, the new is up and rocking, no additional configuration required. I also recommend dropping your firmware files on your TFTPd server as well, as your phones will automatically download updates when you place them there.
In our setup we run multiple VLANs in our office, VLAN 210 we use for our workstations and we assigned this as the untagged VLAN from our switch so no configuration of workstations is required. We then run VLAN 4000 as a dedicated VLAN for VoIP. This is a tagged however, the Aastra phones must tag their packets for VLAN 4000. Since this is configured on the phones, and I didn’t want to have to manually configure phones this means that the DHCP server running on VLAN 210 must also give the boot-server paramter. The first time the phones boot up they will be on your untagged VLAN since they have not yet been configured for tagged. In our setup the phones download our aastra.cfg file, which amoung other things, contains:
tagging enabled: 1
VLAN id: 4000
once the phones have downloaded this file, they switch to VLAN tagging mode and reboot and start the whole process over again. This time however, they will be tagging all their packets for VLAN 4000.
Next we need to configure our Dell 3548P switch to setup VLAN 4000. The newer Dell switches come with some built in stuff designed specifically for doing VoIP VLANs. Using the Dell stuff, your switch will automatically be doing Quality of Service (QoS) for you at the layer 2 level using Class of Service (CoS). How the Dell switches do this is pretty configurable, so if you do use the Dell method, you won’t be stuck using default settings of what Dell thinks are best. Anyways, to setup VLAN 4000, I did this via the CLI as I find the web interface for the Dell switches to be rather slow.
console# configure
console(config)# vlan database
console(config-vlan)# vlan 4000
console(config-vlan)# exit
console(config)# interface vlan 4000
console(config-if)# name VOIP1
console(config-if)# ip address 10.20.200.3/24 <– optional
console(config-if)# exit
console(config)# voice vlan oui-table add 00085d Aastra_Phones
console(config)# voice vlan oui-table add 000e08 Linksys_ATA
console(config)# voice vlan id 4000
console(config)# interface range ethernet all
Configuring all ports may consume an excessive amount of time. Define only the required ports to save time.
Do you wish to continue? (Y/N)[N] Y
console(config-if)# voice vlan enable
console(config-if)# exit
console(config)# exit
console# copy running-config startup-config
Thats it! Your switch is now setup with a dedicated VLAN for VoIP and your switch is now prioritizing packets for your voice vlan. You may not wish to enable voice vlan on all ports, for the purpose of this post I specificed all, but you could also say
interface range ethernet e1-e12
or if you are using a stack of switches
interface range ethernet 1/e1-1/e19,2/e15-2/e25,4/e19-4/e33
I will also get into some layer 3 QoS using DSCP/ToS in a later part, when we take the VoIP project from our stage 1 phase, to implementing it on an organization-wide basis in stage 2.
Check back later for Part 4, where I will get into some specific Asterisk and FreePBX configuration.


June 9th, 2008 at 7:06 pm
This series is a good read. Thank for your sharing your experience. I’d like to invite you to consider participating in the weekly VOIP Users Conference (http://www.voipusersconference.org/). This is a conference call the brings together people with Asterisk experience to share their knowledge. There are usually interesting interviews and lots of assistance to share.
The group also has a community web site is at http://www.voipusersconference.org/ning