1/问答题
Route-map在策略路由中的应用
实验作业:
按要求在GNS上部署实验环境如图:
[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-JNJAOZRG-1632585800221)(/Users/aron/Desktop/highroute2.png)]
1、R1、R2模拟内网主机,与R3运行OSPF协议,实现内网联通;
配置IP地址,是互相连通;
R1
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)
R1(config-if)
R1(config-if)
R1(config-if)
R2
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)
R2(config-if)
R2(config-if)
R3
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)
R3(config-if)
R3(config-if)
R3(config-if)
R3(config-if)
R3(config-if)
R3(config)
R3(config-if)
R3(config-if)
R3(config-if)
R3(config-if)
R3(config-if)
R3(config-if)
验证R3
R3
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 192.168.1.3 YES manual up up
FastEthernet1/0 192.168.2.3 YES manual up up
FastEthernet2/0 100.1.34.3 YES manual up up
FastEthernet3/0 100.1.35.3 YES manual up up
R4
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)
R4(config-if)
R4(config-if)
R4(config-if)
R4(config-if)
R4(config-if)
验证R4
R4
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet1/0 unassigned YES unset administratively down down
FastEthernet2/0 unassigned YES unset administratively down down
FastEthernet3/0 100.1.34.4 YES manual up up
Loopback1 4.4.4.4 YES manual up up
R4
R5
Enter configuration commands, one per line. End with CNTL/Z.
R5(config)
R5(config-if)
R5(config-if)
R5(config-if)
R5(config-if)
R5(config-if)
验证R5:
R5
Interface IP-Address OK? Method Status Protocol
FastEthernet0/0 unassigned YES unset administratively down down
FastEthernet1/0 unassigned YES unset administratively down down
FastEthernet2/0 100.1.35.5 YES manual up up
FastEthernet3/0 unassigned YES unset administratively down down
Loopback1 5.5.5.5 YES manual up up
R5
测试连通性:
R5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.35.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 96/124/160 ms
R5
R4
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 100.1.34.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 128/135/144 ms
R4
R1、R2模拟内网主机,与R3运行OSPF协议,实现内网联通
R1
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)
R1(config-router)
R1(config-router)
R1(config-router)
R1(config-router)
R2(config-if)
R2(config-router)
R2(config-router)
R2(config-router)
R3(config-if)
R3(config-if)
R3(config-router)
R3(config-router)
R3(config-router)
R3(config-router)
R1
O 192.168.2.0/24 [110/2] via 192.168.1.3, 00:22:49, FastEthernet0/0
R1
R2
O 192.168.1.0/24 [110/2] via 192.168.2.3, 00:22:44, FastEthernet1/0
R2
2、R3下发OSPF默认路由,使得R1、R2能够访问互联网;
R3下发OSPF默认路由,使得R1、R2能够访问互联网
R3
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)
R3(config-router)
R3(config-router)
3、R3上部署策略路由PBR技术,使得R1访问互联网走R4方向,使得R2访问互联网走R5方向;
R3上部署策略路由PBR技术,使得R1访问互联网走R4方向,使得R2访问互联网走R5方向
R3
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)
R3(config)
R3(config)
R3(config-route-map)
R3(config-route-map)
R3(config-route-map)
R3(config-route-map)
R3(config-route-map)
R3(config-if)
R3(config-if)
R3(config-if)
R3(config-if)
R3(config-if)
验证:
R3
Standard IP access list 1
10 permit 192.168.1.0, wildcard bits 0.0.0.255 (67 matches)
Standard IP access list 2
10 permit 192.168.2.0, wildcard bits 0.0.0.255 (48 matches)
R3
route-map r4, permit, sequence 10
Match clauses:
ip address (access-lists): 1
Set clauses:
ip next-hop 100.1.34.4
Policy routing matches: 23 packets, 2460 bytes
route-map r5, permit, sequence 10
Match clauses:
ip address (access-lists): 2
Set clauses:
ip next-hop 100.1.35.5
Policy routing matches: 5 packets, 570 bytes
R3
Interface Route map
Fa0/0 r4
Fa1/0 r5
R3
*Mar 1 01:51:36.495: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, len 100, FIB policy match
*Mar 1 01:51:36.495: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, g=100.1.34.4, len 100, FIB policy routed
*Mar 1 01:51:36.815: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, len 100, FIB policy match
*Mar 1 01:51:36.815: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, g=100.1.34.4, len 100, FIB policy routed
*Mar 1 01:51:36.979: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, len 100, FIB policy match
*Mar 1 01:51:36.979: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, g=100.1.34.4, len 100, FIB policy routed
R3
*Mar 1 01:51:37.203: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, len 100, FIB policy match
*Mar 1 01:51:37.203: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, g=100.1.34.4, len 100, FIB policy routed
*Mar 1 01:51:37.431: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, len 100, FIB policy match
*Mar 1 01:51:37.431: IP: s=192.168.1.1 (FastEthernet0/0), d=4.4.4.4, g=100.1.34.4, len 100, FIB policy routed
R3
R1上ping 验证等:
R1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 4.4.4.4, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 128/188/240 ms
R1
*Mar 1 01:39:20.587: ICMP: echo reply rcvd, src 4.4.4.4, dst 192.168.1.1
*Mar 1 01:39:20.763: ICMP: echo reply rcvd, src 4.4.4.4, dst 192.168.1.1
*Mar 1 01:39:20.963: ICMP: echo reply rcvd, src 4.4.4.4, dst 192.168.1.1
*Mar 1 01:39:21.163: ICMP: echo reply rcvd, src 4.4.4.4, dst 192.168.1.1
*Mar 1 01:39:21.295: ICMP: echo reply rcvd, src 4.4.4.4, dst 192.168.1.1
R1
Type escape sequence to abort.
Tracing the route to 4.4.4.4
1 192.168.1.3 72 msec 68 msec 156 msec
2 100.1.34.4 104 msec 216 msec 196 msec
R1
*Mar 1 01:41:10.779: ICMP: time exceeded rcvd from 192.168.1.3
*Mar 1 01:41:10.847: ICMP: time exceeded rcvd from 192.168.1.3
*Mar 1 01:41:11.007: ICMP: time exceeded rcvd from 192.168.1.3
*Mar 1 01:41:11.115: ICMP: dst (192.168.1.1) port unreachable rcv from 100.1.34.4
*Mar 1 01:41:11.335: ICMP: dst (192.168.1.1) port unreachable rcv from 100.1.34.4
*Mar 1 01:41:11.535: ICMP: dst (192.168.1.1) port unreachable rcv from 100.1.34.4
r2验证:
R2
ICMP packet debugging is on
R2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 100/272/388 ms
R2
*Mar 1 01:40:15.199: ICMP: echo reply rcvd, src 5.5.5.5, dst 192.168.2.1
*Mar 1 01:40:15.515: ICMP: echo reply rcvd, src 5.5.5.5, dst 192.168.2.1
*Mar 1 01:40:15.615: ICMP: echo reply rcvd, src 5.5.5.5, dst 192.168.2.1
*Mar 1 01:40:16.007: ICMP: echo reply rcvd, src 5.5.5.5, dst 192.168.2.1
R2
*Ma
4、此处R3上不要求部署NAT技术,要求R4和R5部署静态路由,实现内网流量返回。
R4
Enter configuration commands, one per line. End with CNTL/Z.
R4(config)
R4(config)
R5
Enter configuration commands, one per line. End with CNTL/Z.
R5(config)
R5(config)
R5(config)
---------
【作业要求】 1、用GNS3搭建拓扑,并根据要求完成项目; 2、将整个GNS3项目文件打包为压缩包,并以附件上传,压缩包的名称规范为“姓名-Route-map-2”。
***编写实验报告,将整个作业过程中的涉及的步骤、效果、思路等整理为Word或PDF或PPT文档并上传,文档名称为"姓名-作业名称"。
|