Dos rutas PSTN e IP WAN

pstndid2
Bueno, en este post, vamos a empezar desde cero, from scratch, lo que más nos gusta, que es hacer sonar un par de teléfonos. Tenemos dos routers. Router 1 y Router 2. Ambos servidores DHCP para voz y datos y con CME instalado.

Los routers tienen una tarjeta VWIC 1MFT-E1 que emulará la línea PSTN.

Utilizaremos un prefijo, para que, cuando la línea WAN caiga, la llamada pase a través de la red PSTN. Bueno, esa es la idea. A ver si nos sale. Sí, salió perfectamente.

Para este laboratorio utilizaremos:

1 router 2811 con IOS c2800nm-ipvoicek9-mz.151-3.T.bin
1 router 2801 con IOS c2801-adventerprisek9_ivs-mz.151-4.M4.bin
2 switch Catalyst 3550 con IOS c3550-ipservicesk9-mz.122-52.SE.bin
1 cable de red CRUZADO.
1 cable T1

Vamos a ver la configuración de Router 1:

Router#configure terminal
Router(config)#hostname Router1
Router1(config)#no ip domain-lookup
Router1(config)#line console 0
Router1(config-line)#loggin synchronous
Router1(config-line)#exec-timeout 0 0
Router1(config-line)#end

Router1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet0/1 unassigned YES unset administratively down down

Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface fa0/0.10
Router1(config-subif)#encapsulation dot1q 10
Router1(config-subif)#description VLAN DATOS
Router1(config-subif)#ip address 192.168.10.1 255.255.255.0
Router1(config-subif)#interface fa0/0.5
Router1(config-subif)#encapsulation dot1q 5
Router1(config-subif)#description VLAN VOZ
Router1(config-subif)#ip address 10.10.0.1 255.255.255.0
Router1(config-subif)#exit
Router1(config)#interface fa0/0
Router1(config-if)#no shutdown
Router1(config-if)#ip dhcp excluded-address 192.168.10.1 192.168.10.10
Router1(config)#ip dhcp pool Datos
Router1(dhcp-config)#default-router 192.168.10.1
Router1(dhcp-config)#network 192.168.10.0 255.255.255.0
Router1(dhcp-config)#exit
Router1(config)#ip dhcp excluded-address 10.10.0.1 10.10.0.10
Router1(config)#ip dhcp pool Voz
Router1(dhcp-config)#default-router 10.10.0.1
Router1(dhcp-config)#option 150 ip 10.10.0.1
Router1(dhcp-config)#network 10.10.0.0 255.255.255.0
Router1(dhcp-config)#exit
Router1(config)#end

Router1#configure terminal
Router1(config)#telephony-service
Router1(config-telephony)#end
Router1(config)#telephony-service
Router1(config-telephony)#no auto-reg-ephone
Router1(config-telephony)#max-ephones 4
Router1(config-telephony)#max-dn 10
Router1(config-telephony)#ip source-address 10.10.0.1
Router1(config-telephony)#create cnf-files
Creating CNF files
CNF-FILES: Clock is not set or synchronized, retaining old versionStamps

Router1(config-telephony)#end

Router1#configure terminal
Router1(config)#ephone-dn 1 dual-line
Router1(config-ephone-dn)#number 1001
Router1(config-ephone-dn)#exit
Router1(config)#ephone 1
Router1(config-ephone)#mac-address 00c0.9f70.94d9
Router1(config-ephone)#button 1:1
Router1(config-ephone)#end
Router1#
Router1#configure terminal
Router1(config)#telephony-service
Router1(config-telephony)#no create cnf-files
CNF files deleted

Router1(config-telephony)#create cnf-files
Creating CNF files
CNF-FILES: Clock is not set or synchronized, retaining old versionStamps

Router1(config-telephony)#end

Router1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM up up
FastEthernet0/0.5 10.10.0.1 YES NVRAM up up
FastEthernet0/0.10 192.168.10.1 YES NVRAM up up
FastEthernet0/1 unassigned YES NVRAM administratively down down
Router1#

 

Vamos a configurar el Router 2

Router#configure terminal
Router(config)#hostname Router2
Router2(config)#no ip domain-lookup
Router2(config)#line console 0
Router2(config-line)#loggin synchronous
Router2(config-line)#exec-timeout 0 0
Router2(config-line)#end
Router2#
Router2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet0/1 unassigned YES unset administratively down down
Router2#
Router2#configure terminal
Router2(config)#interface fa0/0.10
Router2(config-subif)#encapsulation dot1q 10
Router2(config-subif)#description VLAN DATOS
Router2(config-subif)#ip address 192.168.20.1 255.255.255.0
Router2(config-subif)#interface fa0/0.5
Router2(config-subif)#encapsulation dot1q 5
Router2(config-subif)#description VLAN VOZ
Router2(config-subif)#ip address 20.20.0.1 255.255.255.0
Router2(config-subif)#exit
Router2(config)#interface fa0/0
Router2(config-if)#no shutdown
Router2(config-if)#ip dhcp excluded-address 192.168.20.1 192.168.20.10
Router2(config)#ip dhcp pool Datos
Router2(dhcp-config)#default-router 192.168.20.1
Router2(dhcp-config)#network 192.168.20.0 255.255.255.0
Router2(dhcp-config)#exit
Router2(config)#ip dhcp excluded-address 20.20.0.1 20.20.0.10
Router2(config)#ip dhcp pool Voz
Router2(dhcp-config)#default-router 20.20.0.1
Router2(dhcp-config)#option 150 ip 20.20.0.1
Router2(dhcp-config)#network 20.20.0.0 255.255.255.0
Router2(dhcp-config)#exit
Router2(config)#end
Router2#

Router2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset up down
FastEthernet0/0.5 20.20.0.1 YES manual up down
FastEthernet0/0.10 192.168.20.1 YES manual up down
FastEthernet0/1 unassigned YES unset administratively down down
Router2#

Router2#configure terminal
Router2(config)#telephony-service
Router2(config-telephony)#no auto-reg-ephone
Router2(config-telephony)#max-ephones 4
Router2(config-telephony)#max-dn 10
Router2(config-telephony)#ip source-address 20.20.0.1
Router2(config-telephony)#create cnf-files
Creating CNF files
CNF-FILES: Clock is not set or synchronized, retaining old versionStamps

Router2(config-telephony)#end
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#ephone-dn 1 dual-line
Router2(config-ephone-dn)#number 2001
Router2(config-ephone-dn)#exit
Router2(config)#ephone 1
Router2(config-ephone)#mac-address 00A0.D168.2709
Router2(config-ephone)#button 1:1
Router2(config-ephone)#end
Router2#
Router2#configure terminal
Router2(config)#telephony-service
Router2(config-telephony)#no create cnf-files
CNF files deleted

Router2(config-telephony)#create cnf-files
Creating CNF files
CNF-FILES: Clock is not set or synchronized, retaining old versionStamps

Router2(config-telephony)#end
Router2#

Volvemos al Router 1:

Router1#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM up up
FastEthernet0/0.5 10.10.0.1 YES NVRAM up up
FastEthernet0/0.10 192.168.10.1 YES NVRAM up up
FastEthernet0/1 unassigned YES NVRAM administratively down down
Router1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router1(config)#interface fa0/1
Router1(config-if)#ip address 172.16.0.1 255.255.255.0
Router1(config-if)#no shutdown
Router1(config-if)#end
Router1#

Conectamos Router1 con Router2 con un cable de red CRUZADO.
Acordaos que de Router a Router el cable de red ha de ser cruzado, u os volveréis gilipollas sin entender porqué está caído el link. Que me lo digan a mi.

Router2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM up up
FastEthernet0/0.5 20.20.0.1 YES NVRAM up up
FastEthernet0/0.10 192.168.20.1 YES NVRAM up up
FastEthernet0/1 unassigned YES NVRAM administratively down down
Router2#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router2(config)#interface fa0/1
Router2(config-if)#ip address 172.16.0.2 255.255.255.0
Router2(config-if)#no shutdown
Router2(config-if)#end
Router2#show ip interface brief
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES NVRAM up up
FastEthernet0/0.5 20.20.0.1 YES NVRAM up up
FastEthernet0/0.10 192.168.20.1 YES NVRAM up up
FastEthernet0/1 172.16.0.2 YES manual up down

Router2#ping 172.16.0.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.0.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/4 ms
Router2#

Configuramos el dia-peer voip en cada router.

Router1#
Router1#configure terminal
Router1(config)#dial-peer voice 10 voip
Router1(config-dial-peer)#destination-pattern 2…
Router1(config-dial-peer)#session target ipv4:172.16.0.2
Router1(config-dial-peer)#exit
Router2#
Router2#configure terminal
Router2(config)#dial-peer voice 10 voip
Router2(config-dial-peer)#destination-pattern 1…
Router2(config-dial-peer)#session target ipv4:172.16.0.1
Router2(config-dial-peer)#exit
Router2(config)#end
Router2#

Comprobamos que funciona perfectamente.

Vamos a configurar la linea PSTN.

Router1#show controller e1
E1 0/3/0 is down.

Router1#configure terminal
Router1(config)#isdn switch-type primary-net5
Router1(config)#network-clock-participate wic 3
Router1(config)#controller e1 0/3/0
Router1(config-controller)#pri-group timeslots 1-3, 16
Router1(config-controller)#no shutdown
Router1(config-controller)#end
Router1#

Router2#show controllers e1
E1 0/3/0 is down.

Router2#configure terminal
Router2(config)#isdn switch-type primary-net5
Router2(config)#network-clock-participate wic 3
Router2(config)#controller e1 0/3/0
Router2(config-controller)#pri-group timeslots 1-3, 16
Router2(config-controller)#no shutdown
Router2(config-controller)#end
Router2#configure terminal
Router2(config)#interface serial 0/3/0:15
Router2(config-if)#isdn protocol-emulate network
Router2(config-if)#end
Router2#

Router2#show isdn status
Global ISDN Switchtype = primary-net5
ISDN Serial0/3/0:15 interface
******* Network side configuration *******
dsl 0, interface ISDN Switchtype = primary-net5
Layer 1 Status:
ACTIVE
Layer 2 Status:
TEI = 0, Ces = 1, SAPI = 0, State = MULTIPLE_FRAME_ESTABLISHED
Layer 3 Status:
0 Active Layer 3 Call(s)
Active dsl 0 CCBs = 0
The Free Channel Mask: 0x80000007
Number of L2 Discards = 0, L2 Session ID = 1
Total Allocated ISDN CCBs = 0
Router2#

Vamos a darle un número externo a cada teléfono. El número que utilizaremos cuando la llamada pase a través de la línea PSTN

En Router1:

ephone-dn 1 dual-line
number 1001 secondary 9123451001

Configuramos el dial-peer en Router 2:

Router2#
Router2#configure terminal
Router2(config)#dial-peer voice 20 pots
Router2(config-dial-peer)#destination-pattern 1…
Router2(config-dial-peer)#port 0/3/0:15
Router2(config-dial-peer)#no digit-strip
Router2(config-dial-peer)#prefix 912345
Router2(config-dial-peer)#end

Quitamos el cable de red cruzado entre Router1 y Router2 y nos quedamos solamente con el cable T1.

Llamamos de 2001 a 1001:

Y auto-mágicamente la llamada se realiza a 9123451001.

prefijo1

En los dial-peer utilizaremos el comando preference 0 para voip y preference 1 para pots.

Router2#debug isdn q931
debug isdn q931 is ON.
Router2#
*May 24 17:30:50.215: ISDN Se0/3/0:15 Q931: Applying typeplan for sw-type 0x12 is 0x0 0x1, Calling num 2001
*May 24 17:30:50.219: ISDN Se0/3/0:15 Q931: Sending SETUP callref = 0x0086 callID = 0x8007 switch = primary-net5 interface = Network
*May 24 17:30:50.219: ISDN Se0/3/0:15 Q931: TX -> SETUP pd = 8 callref = 0x0086
Bearer Capability i = 0x8090A3
Standard = CCITT
Transfer Capability = Speech
Transfer Mode = Circuit
Transfer Rate = 64 kbit/s
Channel ID i = 0xA98381
Exclusive, Channel 1
Progress Ind i = 0x8183 – Origination address is non-ISDN
Router2#
Calling Party Number i = 0x0180, ‘2001’
Plan:ISDN, Type:Unknown
Called Party Number i = 0x81, ‘9123451001’
Plan:ISDN, Type:Unknown
*May 24 17:30:50.271: ISDN Se0/3/0:15 Q931: RX <- CALL_PROC pd = 8 callref = 0x8086
Channel ID i = 0xA98381
Exclusive, Channel 1

NOTA:  La configuración de los switch la tenéis en esta misma web, en el post titulado “Configurar router dhcp para voz y datos”. Pero bueno, la copio aquí otra vez.

Switch (config)# vlan 10
Switch (config-vlan)# name Datos
Switch (config-vlan)# vlan 5
Switch (config-vlan)# name Voz
Switch (config-vlan)#exit
Switch (config)# interface fastethernet 0/1
Switch (config-if)# switchport mode trunk
Switch (config-if)# exit
Switch (config)# interface range fastethernet 0/2 – 24
Switch (config-if-range)# switchport mode access
Switch (config-if-range)# switchport access vlan 10
Switch (config-if-range)# switchport voice vlan 5
Switch (config-if-range)# exit

Agradecimientos:

En este caso le tenemos que dar las gracias a Jeremy Cioara y Michael Valentine, ya que es un ejemplo sacado del libro CCNA Voice 640-461 – Official Certification Guide.

 

Comments are closed.