路由器MP故障的分析解決辦法
一般在路由器上啟用動態(tài)路由協(xié)議動態(tài)地學(xué)習(xí)網(wǎng)絡(luò)拓?fù)?,會遇到這樣的問題,當(dāng)一臺非授權(quán)的網(wǎng)絡(luò)設(shè)備接入網(wǎng)絡(luò),并發(fā)布路由協(xié)議更新時,有可能會使網(wǎng)絡(luò)內(nèi)的設(shè)備動態(tài)的產(chǎn)生錯誤的路由條目,從而造成數(shù)據(jù)包的丟失或者被路由到了錯誤的地方,這時我們就要用到PBR。
一、所謂PBR是一種靈活的數(shù)據(jù)包路由轉(zhuǎn)發(fā)機(jī)制,通過在路由器上應(yīng)用策略路由,使路由器根據(jù)路由映射決定經(jīng)過路由器的數(shù)據(jù)包如何處理,路由映射決定了一個數(shù)據(jù)包的下一跳轉(zhuǎn)發(fā)路由器。
二、在路由器上應(yīng)用策略路由,必須要指定策略路由使用的路由映射,并且要創(chuàng)建路由映射,一個路由映射由很多條策略組成,每個策略都定義了1個或多個匹配規(guī)則和對應(yīng)操作。
三、一個接口應(yīng)用策略路由后,將對該接口收到的所有包進(jìn)行檢查,不符合路由映射中所定義的數(shù)據(jù)包將會被按照正常路由轉(zhuǎn)發(fā)進(jìn)行處理,符合路由映射中的策略的數(shù)據(jù)包,就按照策略中定義的操作進(jìn)行處理。
四、假設(shè)路由器的E0/0口作為內(nèi)部網(wǎng)絡(luò)的網(wǎng)關(guān),地址為200.1.1.1,內(nèi)部網(wǎng)絡(luò)有一個WEB服務(wù)器,地址為200.1.1.100,和 WEB同一網(wǎng)段內(nèi)有用戶電腦一臺,在外部網(wǎng)絡(luò)有一個遠(yuǎn)程的用戶,IP地址為199.1.1.100,允許遠(yuǎn)程用戶能夠訪問WEB服務(wù)器,但不允許訪問內(nèi)部用戶的電腦。
配置:
1、Router(config)#interface Ethernet0/0;
2、Router(config-if)#ip address 200.1.1.1 255.255.255.0;
3、Router(config-if)#exit;
4、Router(config)#interface Ethernet0/1;
5、Router(config-if)#ip address 199.1.1.1 255.255.255.0;
6、Router(config-if)#exit。
測試:
1、Router#ping 200.1.1.100;
2、Type escape sequence to abort.;
3、Sending 5, 100-byte ICMP Echos to 200.1.1.100, timeout is 2 seconds;
4、!!!!!;
5、Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms;
6、Router #ping 200.1.1.10;
7、Type escape sequence to abort;
8、Sending 5, 100-byte ICMP Echos to 200.1.1.10, timeout is 2 seconds;
9、!!!!!;
10、Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms;
11、Router #ping 199.1.1.100;
12、Type escape sequence to abort;
13、Sending 5, 100-byte ICMP Echos to 199.1.1.100, timeout is 2 seconds;
14、!!!!!;
15、Success rate is 100 percent (5/5), round-trip min/avg/max = 1/3/4 ms。
ACL:
Router(config)#access-list 100 permit ip host 199.1.1.1 host 200.1.1.10。
null0接口:
1、Router(config)#interface null 0;
2、Router(config-if)#no ip unreachables。
映射:
1、Router(config)#route-map pbr;
2、Router(config- route-map)#match ip address 100;
3、Router(config- route-map)#set interface null 0。
在E0/1接口上打開NETFLOW交換功能,并在該接口上調(diào)用PBR:
1、Router(config)#interface Ethernet0/1;
2、Router(config-if)#ip route-cache flow;
3、Router(config-if)# ip policy route-map pbr ;
4、Router(config-if)#exit。
連通性測試:
1、C:\>ping 200.1.1.100;
2、Pinging 200.1.1.100 with 32 bytes of data;
3、Reply from 200.1.1.100: bytes=32 time<1ms TTL=128;
4、Reply from 200.1.1.100: bytes=32 time<1ms TTL=128;
5、Reply from 200.1.1.100: bytes=32 time<1ms TTL=128;
6、Reply from 200.1.1.100: bytes=32 time<1ms TTL=128;
7、Ping statistics for 200.1.1.100;
8、Packets: Sent = 4, Received = 4, Lost = 0 (0% loss);
9、Approximate round trip times in milli-seconds;
10、Minimum = 0ms, Maximum = 0ms, Average = 0ms;
11、C:\>ping 200.1.1.10;
12、Pinging 200.1.1.10 with 32 bytes of data;
13、Request timed out;
14、Request timed out;
15、Request timed out;
16、Request timed out;
17、Ping statistics for 200.1.1.10;
18、Packets: Sent = 4, Received = 0, Lost = 4 (100% loss)。
這時外網(wǎng)的遠(yuǎn)程用戶已經(jīng)無法ping通內(nèi)部的用戶了,但是還是可以ping通WEB服務(wù)器,我們目的也達(dá)到了。