路由策略小案例
路由策略和策略路由不一样,策略路由是先执行策略后查看路由;路由策略是先执行路由再查看策略。R1:conf terint loo 0ip add 10.1.1.1255.255.255.0no shuint loo 1ip add 10.1.2.1255.255.255.0no shuint loo 2ip add 10.1.3.1255.255.255.0no shuexint f1/0ip add 10.1.4.1255.255.255.0no shuexitrouter ripver 2no aunet 10.0.0.0 //只宣告主类网exitR2:conf terint f1/0ip add 10.1.4.2255.255.255.0no shuint f1/1ip add 10.1.5.1255.255.255.0no shuexitrouter ospf 100net 10.1.5.00.0.0.255 ar 0exitrouter ripver 2no aupassive-interface f1/1//设置接口为被动接口,使其只接受外部rip宣告,自己不宣告ripnet 10.0.0.0exit
R3:conf terint f1/0ip add 10.1.5.2255.255.255.0no shuexitint loo 0ip add 10.1.6.1255.255.255.0no shuint loo 1ip add 10.1.7.1255.255.255.0no shuint loo 2ip add 10.1.8.1255.255.255.0no shuexitrouter ospf 100net 10.1.5.00.0.0.255 ar 0net 10.1.6.00.0.0.255 ar 0net 10.1.7.00.0.0.255 ar 0net 10.1.8.00.0.0.255 ar 0exitR2:access-list 1 permit 10.1.3.0 0.0.0.255 //ACL过滤需要处理的网段route-map test01 deny 10match ip address 1//执行"拒绝ACL 1 的网段"exitroute-map test01permit 15exitrouter os 100//打开目标协议redistribute rip subnets route-map test01//将rip重分布到ospfexitaccess-list 2 permit 10.1.7.0 0.0.0.255 //ACL过滤需要处理的网段route-map test02permit 10match ip address 2set metric 8//执行"ACL2的网段metric 8"exitroute-map test02permit 15set metric 5//执行"其他网段metric 5"exitrouter rip//打开目标协议redistribute ospf 100 rpute-map test02//将ospf重分布到ripexit测试:R1:R1#show ip roCodes: L - local, 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 - OSPFexternal type 2 i - IS-IS, su - IS-IS summary, L1 -IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidatedefault, U - per-user static route o - ODR, P - periodic downloaded staticroute, + - replicated route
Gateway of lastresort is not set
10.0.0.0/8 is variably subnetted, 12subnets, 2 masksC 10.1.1.0/24 is directly connected,Loopback0L 10.1.1.1/32 is directly connected,Loopback0C 10.1.2.0/24 is directly connected,Loopback1L 10.1.2.1/32 is directly connected,Loopback1C 10.1.3.0/24 is directly connected,Loopback2L 10.1.3.1/32 is directly connected,Loopback2C 10.1.4.0/24 is directly connected,FastEthernet1/0L 10.1.4.1/32 is directly connected,FastEthernet1/0R 10.1.5.0/24 via 10.1.4.2,00:00:27, FastEthernet1/0R 10.1.6.1/32 via 10.1.4.2,00:00:27, FastEthernet1/0R 10.1.7.1/32 via 10.1.4.2,00:00:27, FastEthernet1/0R 10.1.8.1/32 via 10.1.4.2,00:00:27, FastEthernet1/0R3:R3#show ip roCodes: L - local, 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 - OSPFexternal type 2 i - IS-IS, su - IS-IS summary, L1 -IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidatedefault, U - per-user static route o - ODR, P - periodic downloaded staticroute, + - replicated route
Gateway of lastresort is not set
10.0.0.0/8 is variably subnetted, 11subnets, 2 masksO E2 10.1.1.0/24 via 10.1.5.1,00:00:44, FastEthernet1/0O E2 10.1.2.0/24 via 10.1.5.1,00:00:44, FastEthernet1/0O E2 10.1.4.0/24 via 10.1.5.1,00:00:44, FastEthernet1/0C 10.1.5.0/24 is directly connected,FastEthernet1/0L 10.1.5.2/32 is directly connected,FastEthernet1/0C 10.1.6.0/24 is directly connected,Loopback0L 10.1.6.1/32 is directly connected,Loopback0C 10.1.7.0/24 is directly connected,Loopback1L 10.1.7.1/32 is directly connected,Loopback1C 10.1.8.0/24 is directly connected,Loopback2L 10.1.8.1/32 is directly connected,Loopback2
生,容易。活,容易。生活,不容易。 听君一席话,省我十本书! 走自己的路,让别人打车去吧。 勿以坑小而不灌,勿以坑大而灌之。 解释就系掩饰,掩饰等于无出色,无出色不如回家休息!!! 勃起不是万能的,但不能勃起却是万万都不能的!
页:
[1]