Wednesday, April 22, 2009

A Cisco CCNA-Voice Lab

Voip Configuration for a CCNA-Voice Lab

Prerequisite

You need to know how to work with dynamips/dynagen for general network emulation. If you are not that familiar or new to this, there are some excellent tutorials out there. Some basic voip concepts especially from CCNA-Voice would be very useful. That’s it!

Scenario

In this lab, I will show how to setup a voip connection using two laptops running Windows XP and dynamips/dynagen emulating offices connected over a WAN link. IP Blue softphones will be used here, so you need install them on both laptops if you have not done so. Physically the two laptops are connected with a crossover UTP cable. You can also use a layer-2 switch if you want. The topology of the overall network is shown in Figure 1. This setup does not require a high-end laptop. One of my laptops just has a single-core Intel Pentium M 1.5 GHz with 512 MB RAM!

Figure 1: Logical layout and

Laptop1 will emulate Office1 network with a Cisco 2691 router as the gateway and CME, an LAN Ethernet switch and an IP Blue softphone instance. You are free to use any other router with the CME feature, if you don’t have the 2691 IOS image. Laptop2 will emulate Office2 with a similar network layout. To emulate the WAN connection, the egress connection of both routers will connect to another Ethernet switch (wan1 and wan2), which are then bridged across each laptop’s physical RJ-45 port. I just used this simple WAN point-to-point connection to keep the focus on the subject matter.

Dynagen’s .net file

Here is the .net file setup for the laptop1’s setup (very similar to laptop’s 2):

autostart = false

ghostios = true

sparsesmem = true

mmap = true

[localhost:7200]


[[2691]]


image = \Program Files\Dynamips\images\C2691-AD.image

ram = 128

idlepc = 0x60a49150 # change accordingly


[[ROUTER C1]]


model = 2691

f0/0 = L1 1

f0/1 = W1 1


[[ETHSW L1]]


1 = access 1

# change the following line, according to your laptop’s loopback address (use dynagen’s “Network device list.cmd”)

2 = access 1 NIO_gen_eth:\Device\NPF_{924ADD11-A35B-420B-BC79-ED058973BB53}


[[ETHSW W1]]

1 = access 1

# change next line to your laptop’s Ethernet port

2 = dot1q 1 NIO_gen_eth:\Device\NPF_{A91A2A20-659A-4291-8C10-E727878AEFF7}


CME Configuration

In order to be sure that your understand each step of the router’s configuration, I have given the logic behind each step.

1. Start with the ip address configurations of the involved interfaces.
interface FastEthernet0/0
description ***LAN connection***
ip address 10.10.10.1 255.255.255.0
!
interface FastEthernet0/1
description ***WAN connection***
ip address 192.168.100.1 255.255.255.0

2. Setup the DHCP server on the CME.
ip dhcp excluded-address 10.10.10.1 10.10.10.10
!
ip dhcp pool voice
network 10.10.10.0 255.255.255.0
default-router 10.10.10.1
option 150 ip 172.16.1.1

3. Since the best practice is to use a loopback address for CME access, lets configure a loopback interface.
interface Loopback0
ip address 172.16.1.1 255.255.255.255

4. Now, comes the configurations related to the CME function itself. You need to specify the max number of directory numbers and ephones required. The source address to be used by cme1 (i.e. lo0) and a system message that appears cool on the phone display.. ;)
telephony-service
max-ephones 2
max-dn 4
ip source-address 172.16.1.1 port 2000
system message KSD Voip System

5. Now configure the specific directory numbers you need. These are the numbers to dialed to reach certain phones. In my case, I created two dns, one for its normal line and another for the emergency line (000). The longer number stated as secondary will be used by external caller for DID.
ephone-dn 1 dual-line
number 1000 secondary 11111000
!
ephone-dn 4
number 000

6. These directory numbers are now ready to be assigned to specific ephones. You can imagine an ephone like a phone descriptor.
ephone 1
mac-address 0200.4C4F.4F50
button 1:1 3:4

The above MAC address is a loopback interface address created in Windows XP, not the same as lo0 in the CME. If you don’t have one (can be checked on XP’s “Network Connections”), you can easily create it. This address will then be used by IP Blue phone for network access. The router is now ready to serve as call processing agent!

7. You can now start IP Blue phone on laptop1, and if you have not used it before, a setup wizard will start to walk you through its basic setup. Just make sure that you use the loopback address specified in step 6 for its interface. If all goes well, the phone will register with cme1, and the following message should appear:

*Mar 1 00:02:47.303: %IPPHONE-6-REGISTER: ephone-1:SEP02004C4F4F50 IP:10.10.10.11 Socket:3 DeviceType:Phone has registered.

Here is the screenshot of ip blue after it has successfully registered. See the cool text above Redial button… Also, note button 1 shows “1000” and the third button “000”.

Figure 2: IP Blue screenshot after successfully registering to CME.

8. Now, repeat steps 1-7 on laptop2. Just remember to change the IP addresses accordingly as well as the directory numbers. I used the following for the directory number.
ephone-dn 1 dual-line
number 2000 secondary 22222000

Verify that phone2’s registration succeeds as above in Office2. At this stage, all basic local configurations are complete. To enable voip calls across our WAN connection, we now face the most important concept in voip, i.e. the dial plan.

9. The dial plan is like a routing table for a router. When CME receives a call, it needs to know how to forward it correctly. For the real world use, we need SIP proxies from voice service providers to enable an end to end voip connection. However, in our example, we just need to indicate to the CME which numbers will invoke SIP messages to the other CME. For example, to enable phone1 to call phone2, we need the following dial plan in cme1.
dial-peer voice 2000 voip
destination-pattern 2222....
session protocol sipv2
session target ipv4:172.17.1.1
dtmf-relay sip-notify
no vad

Since cme1 does not know how to reach cme2’s lo0, instead of using a routing protocol, I just installed a static default route.
ip route 0.0.0.0 0.0.0.0 192.168.100.2

10. Repeat step 9 for cme2, and you are done! You are ready to call away… This is just the basic configuration to get you going. You can now try all the other cool features like intercom, paging and much much more. I did not have access to Cisco Unity Express, so I was not able to include voice mail configurations here, but it should be quite easy too.