路由器MP故障的分析解決辦法
一般在路由器上啟用動態路由協議動態地學習網絡拓撲,會遇到這樣的問題,當一臺非授權的網絡設備接入網絡,并發布路由協議更新時,有可能會使網絡內的設備動態的產生錯誤的路由條目,從而造成數據包的丟失或者被路由到了錯誤的地方,這時我們就要用到PBR。
一、所謂PBR是一種靈活的數據包路由轉發機制,通過在路由器上應用策略路由,使路由器根據路由映射決定經過路由器的數據包如何處理,路由映射決定了一個數據包的下一跳轉發路由器。
二、在路由器上應用策略路由,必須要指定策略路由使用的路由映射,并且要創建路由映射,一個路由映射由很多條策略組成,每個策略都定義了1個或多個匹配規則和對應操作。
三、一個接口應用策略路由后,將對該接口收到的所有包進行檢查,不符合路由映射中所定義的數據包將會被按照正常路由轉發進行處理,符合路由映射中的策略的數據包,就按照策略中定義的操作進行處理。
四、假設路由器的E0/0口作為內部網絡的網關,地址為200.1.1.1,內部網絡有一個WEB服務器,地址為200.1.1.100,和 WEB同一網段內有用戶電腦一臺,在外部網絡有一個遠程的用戶,IP地址為199.1.1.100,允許遠程用戶能夠訪問WEB服務器,但不允許訪問內部用戶的電腦。
配置:
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交換功能,并在該接口上調用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)。
這時外網的遠程用戶已經無法ping通內部的用戶了,但是還是可以ping通WEB服務器,我們目的也達到了。