天天看點

voice lab2 – GK Operations

<a href="http://s3.51cto.com/wyfs02/M01/79/12/wKioL1aH7j-yMHHNAADVSvRTvfo746.png" target="_blank"></a>

<a href="http://s3.51cto.com/wyfs02/M02/79/12/wKioL1aH7kHhdhoIAACWHm9lPIE397.png" target="_blank"></a>

<a href="http://s3.51cto.com/wyfs02/M00/79/14/wKiom1aH7iKjeCjmAABXNtWeLBM808.png" target="_blank"></a>

<a href="http://s3.51cto.com/wyfs02/M00/79/12/wKioL1aH7kbS3JKdAABJ7WxUk14618.jpg" target="_blank"></a>

配置如下:

R1(config)#int lo 0

R1(config-if)#ip add 1.1.1.1 255.255.255.255

R1(config-if)#no shut

R1(config)#gatekeeper

R1(config-gk)#zone local a cisco.com 1.1.1.1

R1(config-gk)#no shut

R1(config)#int f0/1

R1(config-if)#h323-gateway voip interface

R1(config-if)#h323-gateway voip id a ipaddr 1.1.1.1

R1(config-if)#h323-gateway voip bind srcaddr 192.168.100.1

R1(config-if)#h323-gateway voip h323-id r1

R1(config)#dial-peer voice 2000 voip

R1(config-dial-peer)#destination-pattern 2...

R1(config-dial-peer)#session target ras

R1(config-dial-peer)#dtmf-relay h245-a

R1(config-dial-peer)#no vad

R2(config)#int f0/1

R2(config-if)#h323-gateway voip interface

R2(config-if)#h323-gateway voip id a ipadd 1.1.1.1

R2(config-if)#h323-gateway voip bind srcaddr 192.168.3.1

R2(config-if)#exit

R2(config)#gateway

R2(config)#dial-peer voice 1000 voip

R2(config-dial-peer)#destination-pattern 1...

R2(config-dial-peer)#session target ras

R2(config-dial-peer)#dtmf-relay h245-a

R2(config-dial-peer)#no vad

R1#show gatekeeper endpoints

GATEKEEPER ENDPOINT REGISTRATION

================================

CallSignalAddr Port RASSignalAddr Port Zone Name Type Flags

--------------- ----- --------------- ----- --------- ---- -----

192.168.3.1 1720 192.168.3.1 65439 a VOIP-GW

H323-ID: r2

E164-ID: 2001

Voice Capacity Max.= Avail.= Current.= 0

192.168.100.1 1720 192.168.100.1 61114 a VOIP-GW

H323-ID: r1

E164-ID: 1001

E164-ID: 1002

Total number of active registrations = 2

以上是單zone單GK的拓撲用的是e164來解析的。

R1(config-gk)#alias static 192.168.3.1 gkid a e164 2002 《如何手工注冊》

R1(config-gk)#end

R1#show gatek end

192.168.3.1 1720 192.168.3.1 64876 a VOIP-GW D S

E164-ID: 2002 (static)

192.168.100.1 1720 192.168.100.1 58492 a VOIP-GW

試驗結果:1001 ----&gt; 2001 可通

<a href="http://s3.51cto.com/wyfs02/M02/79/12/wKioL1aH7kjBMLwoAAEP8XXBCR0498.png" target="_blank"></a>

======取消自動注冊e164===============

R2(config)#ephone-dn 1

R2(config-ephone-dn)#num 2001 no-reg

R1(config)#ephone-dn 1

R1(config-ephone-dn)#number 1001 no-reg

R1(config-ephone-dn)#exit

R1(config)#ephone-dn 2

R1(config-ephone-dn)#number 1002 no-reg

R1(config-if)#h323-gateway voip tech-prefix 1#

R1(config-if)#end

R1#show gateke gw-type-prefix

GATEWAY TYPE PREFIX TABLE

=========================

Prefix: 1#*

Zone a master gateway list:

192.168.100.1:1720 r1

R1(config-gk)#gw-type-prefix 1# default-technology

R1#show gatek gw

Prefix: 1#* (Default gateway-technology)

試驗結果: 2001----calling ----&gt; 1001 是可通的,如下圖,原因是有default gateway-technology的緣故

但1001----calling---&gt;2001 不通

不過,靜态寫明細e164條目和預設路由都不是正常的部署方案,因為GK可能存在多個default gateway

通常的辦法是添加tech-prefix ,通常我們說的區号

<a href="http://s3.51cto.com/wyfs02/M01/79/12/wKioL1aH7k6xr2YcAAT2qvw4NWw140.png" target="_blank"></a>

PS: translation rules

<a href="http://s3.51cto.com/wyfs02/M00/79/12/wKioL1aH7lXCJt4FAAEKCh8VU3w283.png" target="_blank"></a>

R1(config)#gatekee

R1(config-gk)#no gw-type-pre 1# default \\取消掉default gateway

R2(config-if)#h323-gateway voip tech-prefix 2#

R1#show gatekeeper gw-type-prefix

Prefix: 2#*

192.168.3.1:1720 r2

R1(config)#dial-peer voice 2000 voip \\呼叫2...的号碼前,加上2#

R1(config-dial-peer)#tech-prefix 2#

R2(config)#dial-p voice 1000 voip \\呼叫1...的号碼前,加上1#

R2(config-dial-peer)#tech-prefix 1#

但是還是有個問題,當2#+号碼送到R2上是沒辦法處理的 ,R1 同理

是以R1和R2要做入向裁号

R2(config)#voice translation-rule 1

R2(cfg-translation-rule)#rule 1 /^.*\(2...\)$/ /\1/

R2(cfg-translation-rule)#exit

R2(config)#voice translation-profile for2# \\定義profile name

R2(cfg-translation-profile)#translate called 1\\調用在被叫方向

R2(cfg-translation-profile)#exit

R2(config)#voip-incoming translation-profile for2#

R1(config)#voice translation-rule 1

R1(cfg-translation-rule)#rule 1 /^.*\(1...\)$/ /\1/

R1(cfg-translation-rule)#exit

R1(config)#voice translation-profile for1#

R1(cfg-translation-profile)#translate called 1

R1(cfg-translation-profile)#exit

R1(config)#voip-incoming translation-profile for1#

R1#show voice translation-rule \\察看rules

Translation-rule tag: 1

Rule 1:

Match pattern: ^.*\(1...\)$

Replace pattern: \1

Match type: none Replace type: none

Match plan: none Replace plan: none

R1#show voice translation-pro

R1#show voice translation-profile

Translation Profile: for1#

Rule for Calling number:

Rule for Called number: 1

Rule for Redirect number:

Rule for Redirect-target number:

也可以在dial-peer voice 1111 voip 下調用,看實際情況的應用.

translation-profile outgoing for1#

試驗結果1001 calling 2001 successfully

<a href="http://s3.51cto.com/wyfs02/M00/79/14/wKiom1aH7jbSZ5-aAAEMFnR5-Ho681.png" target="_blank"></a>

一般來說,zone prefix是GK的管理域,一個GK可以有多個zone, zone是用來管理帶寬的 ,它必須跟tech-prefix一起使用

這種情況用的很少

R2(config-if)#int f0/1

R2(config-if)#no h323-gateway voip tech-prefix 2#

R2(config-if)#h323-gateway voip tech-pre 1#

R2(config-if)#gateway

R2(config-gateway)#exit

R1(config)#dial-pee voice 2000 voip

R1(config-dial-peer)#no tech-prefix 2#

R1(config-dial-peer)#tech-prefix 1#

R1(config-dial-peer)#end

\\這樣R1和R2都對1#有管理權

R1(config-gk)#zone prefix a 1 gw-priority 10 r1

R1(config-gk)#zone prefix a 1 gw-priority 0 r2

R1(config-gk)#zone prefix a 2 gw-pri 10 r2

R1(config-gk)#zone prefix a 2 gw-pri 0 r1

Zone a prefix 2* priority gateway list(s):

Priority 10:

Zone a prefix 1* priority gateway list(s):

\\由于r1和r2都宣稱管理tech-prefix是1#的号碼,是以向GK查詢号碼時候"1#1001"

"1#1002"如何路由時,GK認為r1r2均是1#号碼的管理者,當2001----calling----1001時 剝離1#前最後,1001号碼屬于1*歸屬r1管理.

Gk告訴r2應該向r1發起連結

GW h323-ID

Local Zone

E164

Tech-prefix

Zone-prefix

Ip address

R1

a

/

1#

1*

192.168.100.1

R2

2*

192.168.3.1

R1(config)#gatek

R1(config-gk)#no alias static 192.168.3.1 \\清除靜态e164位址.

R1/2(config)#int f0/1

R1/2(config-if)#no h323-gateway voip id a ipaddr 1.1.1.1 1719

R1/2(config-if)#no h323-gateway voip tech-prefix 1# &lt;2#&gt;

R1/2(config-if)#no h323-gateway voip h323-id r1 &lt;r2&gt;

R1/2(config-if)#no h323-gateway voip bind srcaddr 192.168.100.1 &lt;192.168.3.1&gt;

R1/2(config-if)#no h323-gateway voip interface

確定沒有任何endpoints有注冊,如下:

R1#sh gatek endpoints

Total number of active registrations = 0

重新注冊到gk

R1(config-gk)#no zone local a cisco.com 1.1.1.1

R1(config-gk)#zone local a1 cisco.com 1.1.1.1

R1(config-gk)#zone local a2 cisco.com 1.1.1.1

R1(config-gk)#exit

R1(config-if)#h323-gateway voip id a1 ipaddr 1.1.1.1

R2(config-if)# h323-gateway voip id a2 ipaddr 1.1.1.1

R2(config-if)# h323-gateway voip h323-id r2

R2(config-if)# no h323-gateway voip tech-prefix 1#

R2(config-if)# h323-gateway voip bind srcaddr 192.168.3.1

R2(config-if)# h323-gateway voip tech-prefix 2# \\宣告對2#管理

R1(config)#dial-peer voice 2000 voip \\打2#的标

R1(config-dial-peer)#no tech-prefix 1#

結果如下:

R1#sh gatek end

192.168.3.1 1720 192.168.3.1 63388 a2 VOIP-GW

192.168.100.1 1720 192.168.100.1 52448 a1 VOIP-GW

Zone a1 master gateway list:

Zone a2 master gateway list:

R1(config-gk)#zone prefix a1 1*

R1(config-gk)#zone prefix a2 2* \\确定2個zone決定歸屬權問題

R1(config-gk)#bandwidth total zone a1 1280 \\分别對不同的zone的帶寬管理

R1(config-gk)#bandwidth total zone a2 2560

a1

a2

2#

Gk的決策樹:

分為

1管轄層面,不能決定路由,但可以提前拒絕

2 路由層面,e164号碼,tech-prefix+zone prefix,default gw technology + zone prefix每個條件可以決定路由

<a href="http://s3.51cto.com/wyfs02/M01/79/14/wKiom1aH7jniYICwAAMzJOF6haQ870.png" target="_blank"></a>

<a href="http://s3.51cto.com/wyfs02/M02/79/13/wKioL1aH7l7wF56SAABUyuF3eBE873.png" target="_blank"></a>

R2向gk 查詢号碼1#1001,1#1002,gk摘除1#之後1開頭的号碼都屬于1* 歸屬zone a 1管轄,在zone a 1裡1#歸屬于r1管理,是以gk告訴r2向r1 發起呼叫連接配接

這裡我們隻談GK peer to peer

1-在r1和r2分别作zone local和指定zone remote

R1#sh run | be gateke

gatekeeper

zone local a cisco.com 1.1.1.1

zone remote b cisco.com 2.2.2.2 1719

gw-type-prefix 2#* hopoff b

no shutdown

R2#sh run | be gateke

zone local b cisco.com 2.2.2.2

zone remote a ciscocom 1.1.1.1 1719

gw-type-prefix 1#* hopoff a

2-在r1 和r2分别注冊到gk

R2#sh run int f0/1

Building configuration...

Current configuration : 277 bytes

!

interface FastEthernet0/1

ip address 192.168.3.1 255.255.255.0

duplex auto

speed auto

h323-gateway voip interface

h323-gateway voip id b ipaddr 2.2.2.2 1719

h323-gateway voip h323-id r2

h323-gateway voip tech-prefix 2# //宣告對2#有管理權限

h323-gateway voip bind srcaddr 192.168.3.1

R1#sh run int f0/1

Current configuration : 281 bytes

ip address 192.168.100.1 255.255.255.0

h323-gateway voip id a ipaddr 1.1.1.1 1719

h323-gateway voip h323-id r1

h323-gateway voip tech-prefix 1#

h323-gateway voip bind srcaddr 192.168.100.1

3-在r1和r2上分别部署dial-peer

R1#sh run | be dial-peer

dial-peer voice 2000 voip

translation-profile incoming for1#

destination-pattern 2...

session target ras

tech-prefix 2#

dtmf-relay h245-alphanumeric

no vad

R2#sh run | be dial-peer

dial-peer voice 1000 voip

translation-profile incoming for2#

destination-pattern 1...

tech-prefix 1#

R1#sh gateke end

192.168.100.1 1720 192.168.100.1 56259 a VOIP-GW

Total number of active registrations = 1

R1#sh gatek gw

sh

Prefix: 2#* (Hopoff zone b)

R1#show gateke zone prefix

ZONE PREFIX TABLE

=================

GK-NAME E164-PREFIX

------- -----------

a 1*

b 2*

4-定義zone prefix

R1:gatekeeper

zone prefix a 1*

zone prefix b 2*

R2:gatekeeper

a of gka

B of gkb

<a href="http://s3.51cto.com/wyfs02/M00/79/14/wKiom1aH8Rezk_SRAAD1lCLGVP0702.png" target="_blank"></a>

Debug ras

Debug gateke main 5 &lt;10&gt;

Show gatekeep calls

标注:以上實驗全是來自于yeslab…試驗的下載下傳可以到我的網盤下載下傳到.

本文轉自 bilinyee部落格,原文連結:   http://blog.51cto.com/ericfu/1730964     如需轉載請自行聯系原作者

繼續閱讀