VoIP in Cisco Packet Tracer


The following is a list of instructions to configure VoIP phones to work with Cisco routers in Packet Tracer 5.3. In this exercise there are multiple locations connected with serial WAN links which adds a level of complexity.



Sample Network

This network has a total of 4 locations; 2 main offices, a branch office and a basic home network. The routers used are 2811 as they are the only routers with telephony service capability. Also have opted for 2960 switches but any switch would be fine. I have added PC's and laptops as voice functionality can be added to those if desired. I have kept the IP addressing simple to avoid any confusion; the 2 main offices use a Class B address space and the two smaller offices Class C addresses.

Sample Network
Sample network used for the following configuration.

Setting Up

The first thing I like to do when starting any new Packet Tracer activity is to set everything up on the page and lay it out so it is all neat and tidy right from the word go. I also find it very helpful to add labels to most things as it saves a heap of hassle figuring stuff out later on. Don't worry about configuring anything yet - that can be done once everything is connected and looking good. One thing that is not obvious is that the IP phones have to have their power cord connected to make them work; to do this click on the phone and in the Physical tab drag the power unit onto the phone.

Switches

Everything should be connected with lots of red lights - that's fine. The first step is to configure the switches; I like to add descriptions for any significant links (like to routers or servers, etc) then any switchports that have IP phones connected need to be added to their own voice VLAN. Below is the configuration for Switch_A; the same basic configuration then needs to be done for all the switches.
Switch>en
Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
!
!Set hostname for switch:
Switch(config)#hostname Switch_A
!
!Add descriptions for significant interfaces:
Switch_A(config)#int f0/1
Switch_A(config-if)#description LINK TO ROUTER_A
Switch_A(config-if)#ex
!
!Assigning VoIP phone ports to voice VLAN:
Switch_A(config)#int range f0/20 - 24
Switch_A(config-if-range)#switchport voice vlan 1
Switch_A(config-if-range)#spanning-tree portfast 
Switch_A(config-if-range)#ex
!
!Save running configuration:
Switch_A(config)#do copy run start
Destination filename [startup-config]? 
Building configuration...
[OK]
Switch_A(config)#
Notice that I have used the range command to set all the IP phone switchports in one hit. I have also switched on spanning-tree portfast; all this means is that those ports will come up straight away without the delay normally associated with connecting to a switchport. The danger of using this command is that it effectively shuts off spanning tree so should never be used on any trunk links between switches.
Also make sure to use the copy run start command to save the running configuration to NVRAM.


Router Interfaces

The next step is to configure all the router interfaces and get the WAN links working. I have listed Router_A below: the other routers are very similar.
Router>en
Router#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
!
!Set hostname for router:
Router(config)#hostname Router_A
!
!Configure router interfaces:
Router_A(config)#int f0/0
Router_A(config-if)#description LINK TO SWITCH_A
Router_A(config-if)#ip address 172.16.0.1 255.255.0.0
Router_A(config-if)#no shutdown 
Router_A(config-if)#ex
!
Router_A(config)#int s0/0/0
Router_A(config-if)#description LINK TO ROUTER_B
Router_A(config-if)#ip address 203.123.12.1 255.255.255.252
Router_A(config-if)#clock rate 64000
Router_A(config-if)#no shutdown 
Router_A(config-if)#ex
!
Router_A(config)#int s0/1/0
Router_A(config-if)#description LINK TO ROUTER_C
Router_A(config-if)#ip address 203.123.12.5 255.255.255.252
Router_A(config-if)#clock rate 64000
Router_A(config-if)#no shutdown 
Router_A(config-if)#ex
!
Router_A(config)#int s0/0/1
Router_A(config-if)#description LINK TO ROUTER_D
Router_A(config-if)#ip address 203.123.12.9 255.255.255.252
Router_A(config-if)#clock rate 64000
Router_A(config-if)#no shutdown 
Router_A(config-if)#ex


DHCP Server

All the links should now have green lights; you should be able to ping between adjacent routers. You won't be able to ping everywhere yet as there are no routing protocols or static routes set.
Next the routers need to be set as DHCP servers for their networks. Router_A is shown below and the other routers are very similar.
Router_A(config)#ip dhcp pool TEST
Router_A(dhcp-config)#default-router 172.16.0.1
Router_A(dhcp-config)#option 150 ip 172.16.0.1
Router_A(dhcp-config)#network 172.16.0.0 255.255.0.0
Router_A(dhcp-config)#ex
The option 150 command is for the Cisco VoIP phones and tells the client the location of the VoIP TFTP server (in this case it is all running on the same router).
Once all the routers are configured as DHCP servers all the devices should be getting IP addresses. I like to test everything now and make sure the hosts can ping their gateway routers; any configuration typos are best found now instead of trying to track them down later on.


EIGRP

The final bit of configuration before getting into the telephony service is setting an appropriate routing protocol; in this case I have used EIGRP. Router_A is shown below and the other routers should be similar; just with different advertised networks. In simple networks like this I prefer to set no auto-summary; auto summarization is great in a large, well designed network but can be a pain for testing a small network like this.
Router_A(config)#router eigrp 1
Router_A(config-router)#network 172.16.0.0
Router_A(config-router)#network 203.123.12.0
Router_A(config-router)#no auto-summary 
Router_A(config-router)#ex


Call Manager Express

Call Manager Express (CME) is the name for the telephony service that will run on the Cisco routers. I have shown Router_A below and the other routers are pretty much the same.
Router_A(config)#telephony-service 
Router_A(config-telephony)#max-ephones 5
Router_A(config-telephony)#max-dn 5
Router_A(config-telephony)#ip source-address 172.16.0.1 port 2000
Router_A(config-telephony)#auto assign 1 to 5
Router_A(config-telephony)#ex
The first line telephony-service initiates the service on the router; the next two lines set how many phones you want on the network - in this case I have set for 5 phones.
The ip source-address is the location and the port number for the telephony router (in this case it is this router).
The auto assign command just assigns buttons on the phones to the lines - not overly important for this exercise.
Next we have to give telephone numbers to the phones connected to the network (sort of a good idea really). I have shown Router_A below and the important thing here is that a different phone number range is used for each different location. In the Router_A network I have started the numbers with a 1; in the Router_B network they start with a 2, etc.
Router_A(config)#ephone-dn 1
Router_A(config-ephone-dn)#number 1101
Router_A(config-ephone-dn)#ex
!
Router_A(config)#ephone-dn 2
Router_A(config-ephone-dn)#number 1102
Router_A(config-ephone-dn)#ex
!
Router_A(config)#ephone-dn 3
Router_A(config-ephone-dn)#number 1103
Router_A(config-ephone-dn)#ex
Since I only have 3 phones connected in my test network not much point adding any more. If you hover your cursor over each phone it should show an IP address and the line number (eg: 1101, 1102, etc).
With this done you should now be able to make phone calls between phones on the same network; you won't be able to call another location just yet.

Making a Call

To get the full benefit of the wonder you have just created make sure you turn on the sound: Options / Preferences / Play Sound. Then click on a phone and in the GUI tab click the handset and type the number of an adjacent phone. In the picture below I am on line number 1103 and am dialing line 1101.

Dialing

The 1101 phone will start ringing; just click the handset on that phone to answer it. On the phone console Connected should show - that's it; you're on the phone. To fully test, click on the Do Re Mi buttons on the top right of the screen and you should hear the sounds played.

Dialing

Analog Phone

There is a Home VoIP unit and analog phone in Packet Tracer; this is configured exactly the same except that the IP address of the gateway router needs to be put in the Home VoIP unit in the Server Address field. There is one connected to Router_D in this example.


Connecting Locations

So far we should be able to phone within the local networks but not other locations. To be able to connect to other locations the routers need to know where to go to reach the number you have dialed. This is where the different numbering schemes come in; each location should have a different number scheme; in my example Location A numbers start with a 1, Location B start with a 2, the Branch Office a 3 and the Home Office a 4. They are all four digits long - just for simplicity.
This step can be a little confusing so I have listed the configurations for all 4 routers.
Router_A(config)#dial-peer voice 1 voip 
Router_A(config-dial-peer)#destination-pattern 2...
Router_A(config-dial-peer)#session target ipv4:203.123.12.2
Router_A(config-dial-peer)#ex
!
Router_A(config)#dial-peer voice 10 voip 
Router_A(config-dial-peer)#destination-pattern 3...
Router_A(config-dial-peer)#session target ipv4:203.123.12.6
Router_A(config-dial-peer)#ex
!
Router_A(config)#dial-peer voice 100 voip 
Router_A(config-dial-peer)#destination-pattern 4...
Router_A(config-dial-peer)#session target ipv4:203.123.12.10
Router_A(config-dial-peer)#ex
The first line dial-peer voice 1 voip just sets the router to 'route' voice calls and gives it a unique tag number.
The destination-pattern line is the phone number range that you want to get to; for example numbers start with a 2 with 3 other digits following.
Then once we state what phone number range we want to get to we need to specify how we are getting there. This is a bit like a static route except that we put the IP address of the router interface of the router connected to the network we want to get to. In the top example we want to get to the 2... range of numbers via the Router_B interface. Listed below are the configurations for the other routers; hopefully this will make it a little clearer.
Router_B(config)#dial-peer voice 2 voip 
Router_B(config-dial-peer)#destination-pattern 1...
Router_B(config-dial-peer)#session target ipv4:203.123.12.1
Router_B(config-dial-peer)#ex
!
Router_B(config)#dial-peer voice 20 voip 
Router_B(config-dial-peer)#destination-pattern 3...
Router_B(config-dial-peer)#session target ipv4:203.123.12.6
Router_B(config-dial-peer)#ex
!
Router_B(config)#dial-peer voice 200 voip 
Router_B(config-dial-peer)#destination-pattern 4...
Router_B(config-dial-peer)#session target ipv4:203.123.12.10
Router_B(config-dial-peer)#ex
Router_C(config)#dial-peer voice 3 voip 
Router_C(config-dial-peer)#destination-pattern 1...
Router_C(config-dial-peer)#session target ipv4:203.123.12.5
Router_C(config-dial-peer)#ex
!
Router_C(config)#dial-peer voice 30 voip 
Router_C(config-dial-peer)#destination-pattern 2...
Router_C(config-dial-peer)#session target ipv4:203.123.12.2
Router_C(config-dial-peer)#ex
!
Router_C(config)#dial-peer voice 300 voip 
Router_C(config-dial-peer)#destination-pattern 4...
Router_C(config-dial-peer)#session target ipv4:203.123.12.10
Router_C(config-dial-peer)#ex
Router_D(config)#dial-peer voice 4 voip 
Router_D(config-dial-peer)#destination-pattern 1...
Router_D(config-dial-peer)#session target ipv4:203.123.12.9
Router_D(config-dial-peer)#ex
!
Router_D(config)#dial-peer voice 40 voip 
Router_D(config-dial-peer)#destination-pattern 2...
Router_D(config-dial-peer)#session target ipv4:203.123.12.2
Router_D(config-dial-peer)#ex
!
Router_D(config)#dial-peer voice 400 voip 
Router_D(config-dial-peer)#destination-pattern 3...
Router_D(config-dial-peer)#session target ipv4:203.123.12.6
Router_D(config-dial-peer)#ex
That's it - you should now be able to phone any location from any location.

Comments

Popular Posts