昨天去一家公司調試一臺2811的路由器,還是先來做一個簡單的介紹吧!他們這個企業有一個總部與二個分部,他們通過租用電信光纖來做到總部與另外兩個分部互聯起來。現在中國電信已經將光纖布到我們三個點的機房了,已經測試正常了。注意在這個案例裏面我負責的是分佈的調試。
下面我們來看看設備:
現在總部與分部2已經是連通了的,使用的是一個E1模塊做的。現在總部要與分部1連接,在總部與分部路由器上面分別加了一塊VWIC2-2MFT-T1/E1的一個模塊。然後通過中國電信的光纖,讓我們總部與分部連通。
下面我們來看看VWIC2-2MFT-T1/E1這個模塊。
手機效果不好,大家將就一下吧!
我們可以看見,這個模塊上面有兩上T1/E1的接口。
上圖是我已經將VWIC2-2MFT-T1/E1這個模塊加到了分佈的2811路由器上了。
我們現在已經把2811放在機架上了!
我們現在可以看見我們這個模塊上面的兩個E1口已經工作起來了。
這個光纜終端設備就是中國電信的光纜進來以後,通過它接了兩根線出來到我們的8M光端機設備上。
然後由這個“8M光端機”再分出來幾組信號,其實這一塊我也是第一次接觸,對於這些專業名詞的理解只是我個人的!我覺得我的表述有問題吧!也不知道形容的對不對。
好了到此爲止,我們的一些設備大至就介紹到這裏吧!下面我們來看看如何來配置這個E1口的卡呢?如何來起用它呢?
2811(config)#card type e1 0 0 //控制器工作於E1模式 *Oct 19 09:35:08.727: %CONTROLLER-5-UPDOWN: Controller E1 0/0/0, changed state to up 2811(config)#controller e1 0/0/0 //通過這條命令進入我們E1這個模塊上的第一個接口 2811(config-controller)#channel-group 0 timeslots 1-31 // 2811(config-controller)# *Oct 19 09:36:40.943: %LINK-3-UPDOWN: Interface Serial0/0/0:0, changed state to up 這裏給我們提示出來我們接口的名稱。 *Oct 19 09:36:41.943: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/0:0, changed state to up 2811(config)#controller e1 0/0/1 2811(config-controller)#channel-group 0 timeslots 1-31 2811(config-controller)#no shut 2811(config-controller)# *Oct 19 09:38:10.511: %LINK-3-UPDOWN: Interface Serial0/0/1:0, changed state to down *Oct 19 09:38:11.511: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0/1:0, changed state to down |
card type e1 0 0來指定控制器類型爲E1(其中參數0是插槽號,0是模塊號)
channel-group 0 timeslots 1-31 (配置時隙1-31 爲channel-group 0,即channel-group 0包含時隙1-31,它的帶寬就爲64K*31=1984K)
channel-group 1 timeslots 2,7-9,20(配置時隙2,7,8,9,20爲channel-group 1,它的帶寬就爲64*5=320K,在這裏7-9是指一個段,可以採用同樣的命令配置多個channel-group,但需注意channel-group對應不同的數字,而且一個時隙不能包含在多個組當中)
以上就是我們啓有E1接口的命令,其它的命令可以根據自己的需要進行設置。在這裏我們只是將這個接口運行起來。
那麼現在我們來看看如何將兩邊進行連通呢?現在要連通就很簡單了,因爲總部與分部1租用的光纖中國電信那邊的人員已經調試通了,我們就只需在相應的接口上面配置IP地址就完了,但是他們現在提出來的要求是,要將兩個E1口綁定在一起,形成一個4M的。他們給了一個IP地址給我,總部有一個IP地址。那麼現在我們就使用模擬器來模擬這個實驗看看?
現在我們來看看上面這個實驗如何做?
模擬器的拓撲文件:
autostart = false
[localhost]
port = 7200
udp = 10000
workingdir = ..\tmp\
port = 7200
udp = 10000
workingdir = ..\tmp\
`7200`
image = e:\ios\unzip-c7200-advsecurityk9-mz.124-11.T.bin
ram = 128
confreg = 0x2142
exec_area = 64
mmap = false
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
image = e:\ios\unzip-c7200-advsecurityk9-mz.124-11.T.bin
ram = 128
confreg = 0x2142
exec_area = 64
mmap = false
slot0 = PA-C7200-IO-FE
slot1 = PA-4T
`router R1`
model = 7200
console = 2000
s1/0 = R2 s1/0
s1/1 = R2 s1/1
model = 7200
console = 2000
s1/0 = R2 s1/0
s1/1 = R2 s1/1
`router R2`
model = 7200
console = 2001
s1/0 = R1 s1/0
s1/1 = R1 s1/1
model = 7200
console = 2001
s1/0 = R1 s1/0
s1/1 = R1 s1/1
在這裏要注意的是我們總部是R2的路由器,分部1的是R1的路由器。
我們現在把它的基本配置配置起來!
Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#host R1 R1(config)#no ip do lo R1(config)#line con 0 R1(config-line)#logg syn R1(config-line)#exec-timeout 0 0 R1(config-line)#exit R1(config)# |
Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#host R2 R2(config)#no ip do lo R2(config)#line con 0 R2(config-line)#logg syn R2(config-line)#exec-timeout 0 0 R2(config-line)#exit R2(config)# |
我們現在來將兩個端口綁定成邏輯上的一個端口使用。
配置我們總部的路由器。
R2(config)#multilink virtual-template 1 //Multilink接口採用虛擬接口模板的配置信息 R2(config)#interface virtual-template 1 //創建虛擬接口模板 R2(config-if)#ip add 172.16.254.13 255.255.255.0 //給我們虛擬接口模板配置一個IP地址。 R2(config-if)#ppp multilink //打開ppp multilink功能 R2(config-if)#exit R2(config)#int s1/0 R2(config-if)#encapsulation ppp //封閉PPP協議 R2(config-if)#ppp multilink //打開ppp multilink功能 R2(config-if)#no shut //啓用該接口 R2(config-if)#exit R2(config)# *Oct 20 12:49:21.139: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up R2(config)# *Oct 20 12:49:21.143: %ENTITY_ALARM-6-INFO: CLEAR INFO Se1/0 Physical Port Administrative State Down R2(config)#int s1/1 R2(config-if)#encapsulation ppp //封閉PPP協議 R2(config-if)#ppp multilink //打開ppp multilink功能 R2(config-if)#no shut //啓用該接口 R2(config-if)#exit R2(config)# *Oct 20 12:49:40.043: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up R2(config)# *Oct 20 12:49:40.043: %ENTITY_ALARM-6-INFO: CLEAR INFO Se1/1 Physical Port Administrative State Down R2(config)#int lo0 R2(config-if)#ip add 192.168.1.1 255.255.255.0 R2(config-if)#exit R2(config)#int lo1 R2(config-if)#ip add 192.168.2.1 255.255.255.0 R2(config-if)#exit R2(config)# |
配置分部1的路由器
R1(config)#multilink virtual-template 1 R1(config)#interface virtual-template 1 R1(config-if)#ip add 172.16.254.14 255.255.255.0 R1(config-if)#ppp multilink R1(config-if)#exit R1(config)#int s1/0 R1(config-if)#encapsulation ppp R1(config-if)#ppp multilink R1(config-if)#no shut R1(config-if)#exit R1(config)#int s1/ *Oct 20 12:55:41.671: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up1 R1(config)#int s1/1 R1(config-if)# *Oct 20 12:55:41.671: %ENTITY_ALARM-6-INFO: CLEAR INFO Se1/0 Physical Port Administrative State Down *Oct 20 12:55:42.095: %LINK-3-UPDOWN: Interface Virtual-Access2, changed state to up R1(config-if)#en *Oct 20 12:55:42.899: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/0, changed state to up *Oct 20 12:55:43.111: %LINEPROTO-5-UPDOWN: Line protocol on Interface Virtual-Access2, changed state to up R1(config-if)#en ppp R1(config-if)#ppp multilink R1(config-if)#no shut R1(config-if)#exit R1(config)# *Oct 20 12:55:53.387: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up R1(config)# *Oct 20 12:55:53.391: %ENTITY_ALARM-6-INFO: CLEAR INFO Se1/1 Physical Port Administrative State Down R1(config)# *Oct 20 12:55:54.451: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial1/1, changed state to up R1(config)#int lo0 R1(config-if)#ip add 192.168.3.1 255.255.255.0 R1(config-if)#no shut R1(config-if)#exit R1(config)#int lo1 R1(config-if)#ip add 192.168.4.1 255.255.255.0 R1(config-if)#exit R1(config)# |
這裏面的配置與上面我們總部的配置都是一樣的,我們從上面的一些日誌我們可以看到我們配置的端口綁定已經起來了,我們下面來查看一下呢?
R1#show ip int bri Interface IP-Address OK? Method Status Protocol FastEthernet0/0 unassigned YES unset administratively down down Serial1/0 unassigned YES unset up up Serial1/1 unassigned YES unset up up Serial1/2 unassigned YES unset administratively down down Serial1/3 unassigned YES unset administratively down down Virtual-Access1 unassigned YES unset down down Virtual-Template1 172.16.254.14 YES manual down down Virtual-Access2 172.16.254.14 YES TFTP up up Loopback0 192.168.3.1 YES manual up up Loopback1 192.168.4.1 YES manual up up R1# |
測試一下
R1#ping 172.16.254.13 //這個是我們公司總部的路由器上面的IP地址
Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.254.13, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 20/36/72 ms R1# |
我們可以看見,是不是將兩個端口綁定成一個虛擬端口,然後通過這個虛擬端口的IP地址來進行通信,我們現在來查看一下它的接口信息。
R1#show ppp multilink
Virtual-Access2 Bundle name: R2 Remote Endpoint Discriminator: [1] R2 遠端的路由器名 Local Endpoint Discriminator: [1] R1 本地的路由器名 Bundle up for 00:05:48, total bandwidth 3088, load 1/255 我們可以看見總帶寬是3088=1544k*2 Receive buffer limit 24384 bytes, frag timeout 1000 ms 0/0 fragments/bytes in reassembly list 0 lost fragments, 0 reordered 0/0 discarded fragments/bytes, 0 lost received 0xA received sequence, 0xA sent sequence Member links: 2 (max not set, min not set) Se1/0, since 00:05:49 Se1/1, since 00:05:37 No inactive multilink interfaces R1# |
我們來查看一下我們的虛擬接口信息:
R1#show interfaces virtual-access 2 Virtual-Access2 is up, line protocol is up //我們可以看見我們兩個都是up的 Hardware is Virtual Access interface Internet address is 172.16.254.14/24 //我們本地的IP地址 MTU 1500 bytes, BW 3088 Kbit, DLY 100000 usec, //在這裏我們可以看見總帶寬是3088k reliability 255/255, txload 1/255, rxload 1/255 Encapsulation PPP, LCP Open, multilink Open //我們可以查看到我們使用的是PPP 多鏈路已經打開了 Open: IPCP MLP Bundle vaccess, cloned from Virtual-Template1 Vaccess status 0x40, loopback not set Keepalive set (10 sec) DTR is pulsed for 5 seconds on reset Last input 00:03:52, output never, output hang never Last clearing of "show interface" counters 00:07:33 Input queue: 0/75/0/0 (size/max/drops/flushes); Total output drops: 0 Queueing strategy: fifo Output queue: 0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 7 packets input, 548 bytes, 0 no buffer Received 0 broadcasts, 0 runts, 0 giants, 0 throttles 0 input errors, 0 CRC, 0 frame, 0 overrun, 0 ignored, 0 abort 7 packets output, 618 bytes, 0 underruns 0 output errors, 0 collisions, 0 interface resets 0 output buffer failures, 0 output buffers swapped out 0 carrier transitions R1# |
查看一下路由表:
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.254.0/24 is directly connected, Virtual-Access2 C 172.16.254.13/32 is directly connected, Virtual-Access2 //我們可以看見,我們總部的IP地址顯示在這裏了 C 192.168.4.0/24 is directly connected, Loopback1 C 192.168.3.0/24 is directly connected, Loopback0 R1# |
我們現在在兩邊來運行一個路由協議(EIGRP)
R1(config)#router eigrp 100 R1(config-router)#no au R1(config-router)#net 192.168.3.0 0.0.0.255 R1(config-router)#net 192.168.4.0 0.0.0.255 R1(config-router)#net 172.16.254.0 0.0.0.255 R1(config-router)#exit |
在R2裏面配置一下路由協議(EIGRP)
R2(config)#router eigrp 100 R2(config-router)#no au R2(config-router)#net 192.168.1.0 0.0.0.255 R2(config-router)#net 192.168.2.0 0.0.0.255 R2(config-router)#net 172.16.254.0 0.0.0.255 R2(config-router)#exit R2(config)# *Oct 20 13:12:01.943: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 172.16.254.14 (Virtual-Access2) is up: new adjacency |
我們可以看見,它是通過我們的172.16.254.14 (Virtual-Access2)來建立鄰居的。而不是通過我們的物理接口來建立鄰居的。
現在再來查看一下路由表:
R1#sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set
172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.254.0/24 is directly connected, Virtual-Access2 C 172.16.254.13/32 is directly connected, Virtual-Access2 C 192.168.4.0/24 is directly connected, Loopback1 D 192.168.1.0/24 [90/3516928] via 172.16.254.13, 00:01:50, Virtual-Access2 D 192.168.2.0/24 [90/3516928] via 172.16.254.13, 00:01:50, Virtual-Access2 C 192.168.3.0/24 is directly connected, Loopback0 R1# |
從上面我們可以看見這兩個網段是通過我們的虛擬接口來建立起來的。
其實要將多個物理端口綁定成一個邏輯端口的話,方法還有很多,下次有時間再與大家來討論討論。
好了到此爲止我們這個工程所需要用到的知識就差不多了。
好好理解一下吧!應該還是很簡單的!
本文出自 51CTO.COM技術博客