1、官方提供】【实验文档】【实验0020】【VoIP实验】 【实验名称】 VoIP拨号对等体实验。 【实验目的】 掌握路由器作为语音网关实现通过网络实现电话语音传输。 【背景描述】 你是某公司的网管,为了降低北京总公司与广州分公司通话的话费成本,你了解到路由器通过语音模块可以实现网络传输语音,并且不用电话费用,所以你决定通过路由器的语音模块来替公司节约成本。 【技术原理】 VoIP(Voice Over Internet Protocol,因特网语音协议)是一种可以在IP网络上互传模拟音讯或视讯的一种技术,基本结构由网关(GW)和网守(GK)两部分构成。 网关的主要功能是信令处
2、理、H.323协议处理、语音编解码和路由协议处理等,对外分别提供与PSTN网连接的中继接口以及与IP网络连接的接口。 网守的主要功能是用户认证、地址解析、带宽管理、路由管理、安全管理和区域管理。 VoIP拨号对等体的配置是将电话号码与IP 地址进行对应,允许路由器向外拨一个指定的电话号码。 【实现功能】 用路由器模及语音模块实现连接在路由器上的电话能够正常通话。 【实验设备】 1762路由器(两台)、NM-4FXS语音模块(两个)、普通电话(两部) 【实验拓扑】 无标题.jpg (17.6 KB) 2008-11-14 13:42 图 25 【实验步骤】 步骤1
3、 基本配置。 北京路由器基本配置R Red-Giant(config)#hostname beijing beijing(config)#interface serial 1/2 beijing(config-if)#encapsulation ppp beijing(config-if)#ip address 1.1.1.1 255.255.255.0 beijing(config-if)#no sh beijing(config-if)#end R 广州路由器基本配置 Red-Giant>en Red-Giant#conf
4、t Red-Giant(config)#host guangzhou guangzhou(config)#int s 1/2 guangzhou(config-if)#ip address 1.1.1.2 255.255.255.0 guangzhou(config-if)#encap ppp guangzhou(config-if)#no sh guangzhou(config-if)#end 验证测试:测试两个接口能够 Ping通。 guangzhou#ping 1.1.1.1 Sending 5, 100-byte ICMP Echoes to 1.1.1.1, tim
5、eout is 2 seconds: < press Ctrl+C to break > !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 37/37/37 ms 步骤2. 语音接口配置。 北京路由器语音接口配置R beijing(config)#dial-peer voice 1 pots ! 进入到POTS拨号对等体配置模式 beijing(config-dial-peer)#destination-pattern 010111
6、 ! 配置本地语音端口的电话号码 beijing(config-dial-peer)#port 2/0 ! 指定电话接入的接口 beijing(config-dial-peer)# exit beijing(config)#dial-peer voice 2 voip ! 进入到VOIP拨号对等体配置模式 beijing(config-dial-peer)#destination-pattern 020222 ! 配置对方语音端口的电话号码 beijing(config-dial-peer)#session target
7、 ipv4: 1.1.1.2 !指定对端IP地址 beijing(config-dial-peer)#end R 广州路由器语音接口配置 guangzhou#conf t guangzhou(config)#dial-peer voice 11 pots guangzhou(config-dial-peer)#destination-pattern 020222 guangzhou(config-dial-peer)#port 2/0 guangzhou(config-dial-peer)#exi guangzhou(config)#dial
8、peer voice 12 voip guangzhou(config-dial-peer)#destination-pattern 010111 guangzhou(config-dial-peer)#session target ipv4: 1.1.1.1 guangzhou(config-dial-peer)#end 验证测试:测试两部电话可以互相通讯。 【注意事项】 1、dial-peer voice number pots Number参数是一个合法的拨号对等体标识数字,合法的取值范围为1~2147483647,注意拨号对等体的标识符不要重复了。 2、注意seri
9、al接口的封装模式为PPP,两端要相同。 【参考配置】 R 北京路由器参考配置 beijing#sh run Building configuration... Current configuration : 884 bytes version 8.32(building 5) ! hostname beijing ! interface serial 1/2 encapsulation PPP ip address 1.1.1.1 255.255.255.0 interface serial 1/3 interface FastEt
10、hernet 1/0 duplex auto speed auto interface FastEthernet 1/1 duplex auto speed auto interface Null 0 ! dial-peer voice 1 pots destination-pattern 010111 port 2/0 dial-peer voice 2 voip destination-pattern 020222 session target ipv4: 1.1.1.2 voice-port 2/0 vo
11、ice-port 2/1 voice-port 2/2 voice-port 2/3 line con 0 line aux 0 line vty 0 4 login ! end R 广州路由器参考配置 guangzhou#show running-config Building configuration... Current configuration : 908 bytes version 8.32(building 53) ! hostname guangzhou ! interface serial 1/2
12、 encapsulation PPP ip address 1.1.1.2 255.255.255.0 clock rate 64000 interface serial 1/3 interface FastEthernet 1/0 duplex auto speed auto interface FastEthernet 1/1 duplex auto speed auto interface Null 0 ! dial-peer voice 11 pots destination-pattern 020222 port 2/0 ! dial-peer voice 12 voip destination-pattern 010111 session target ipv4: 1.1.1.1 voice-port 2/0 voice-port 2/1 voice-port 2/2 voice-port 2/3 line con 0 line aux 0 line vty 0 4 login !






