实验要求:
利用重发布技术与路由策略满足路由无环且避免选路不佳
实验思路:
一、配置IP地址
[r1]int g 0/0/0 [r1-GigabitEthernet0/0/0]ip a 192.168.12.1 24 [r1]int g 0/0/1 [r1-GigabitEthernet0/0/1]ip a 192.168.13.1 24 [r1-GigabitEthernet0/0/1]int l 0 [r1-LoopBack0]ip a 1.1.1.1 24 [r2]int g 0/0/0 [r2-GigabitEthernet0/0/0]ip a 192.168.12.2 24 [r2]int g 0/0/1 [r2-GigabitEthernet0/0/1]ip a 192.168.24.2 24 [r2-GigabitEthernet0/0/1]int l 0 [r2-LoopBack0]ip a 2.2.2.2 2 [r3]int g 0/0/0 [r3-GigabitEthernet0/0/0]ip a 192.168.13.3 24 [r3]int g 0/0/1 [r3-GigabitEthernet0/0/1]ip a 192.168.34.3 24 [r3-GigabitEthernet0/0/1]int l 0 [r3-LoopBack0]ip a 3.3.3.3 24 [r4]int g 0/0/0 [r4-GigabitEthernet0/0/0]ip a 192.168.24.4 24 [r4]int g 0/0/1 [r4-GigabitEthernet0/0/1]ip a 192.168.34.4 24 [r4-GigabitEthernet0/0/1]int l 0 [r4-LoopBack0]ip a 4.4.4.4 24
二、启动OSPF协议与RIP
[r1]ospf 1 router-id 1.1.1.1 [r1-ospf-1]a 0 [r1-ospf-1-area-0.0.0.0]network 192.168.12.1 0.0.0.0 [r1-ospf-1-area-0.0.0.0]network 192.168.13.1 0.0.0.0 [r2]ospf 1 router-id 2.2.2.2 [r2-ospf-1]a 0 [r2-ospf-1-area-0.0.0.0]network 192.168.12.2 0.0.0.0 [r3]ospf 1 router-id 3.3.3.3 [r3-ospf-1]a 0 [r3-ospf-1-area-0.0.0.0]network 192.168.13.3 0.0.0.0 [r2]rip 1 [r2-rip-1]v 2 [r2-rip-1]network 192.168.24.0 [r3]rip 1 [r3-rip-1]v 2 [r3-rip-1]network 192.168.34.0 [r4]rip 1 [r4-rip-1]v 2 [r4-rip-1]network 192.168.34.0 [r4-rip-1]network 192.168.24.0
三、重发布与路由策略
[r1]ospf 1 [r1-ospf-1]import-route direct [r1]acl 2000 [r1-acl-basic-2000]rule permit source 192.168.13.0 0 [r1]ip ip-prefix aa permit 192.168.12.0 24 [r1]route-policy hcip deny node 10
[r1-route-policy]if-match acl 2000 [r1-route-policy]route-policy hcip deny node 20 [r1-route-policy]if-match ip-prefix aa [r1-route-policy]route-policy hcip permit node 30 [r1-ospf-1]import-route direct route-policy hcip
[r2]rip 1 [r2-rip-1]import-route ospf 1 [r2-ospf-1]import-route rip 1 [r3]ospf 1 [r3-ospf-1]import-route rip 1 [r3-rip-1]import-route ospf 1 [r2]acl 2000 [r2-acl-basic-2000]rule deny source 192.168.34.0 0 [r2-acl-basic-2000]rule permit [r2]ospf 1 [r2-ospf-1]filter-policy 2000 export [r3]acl 2000 [r3-acl-basic-2000]rule deny source 192.168.24.0 0 [r3-acl-basic-2000]rule permit [r3]ospf 1 [r3-ospf-1]filter-policy 2000 export [r4]ip ip-prefix aa permit 192.168.12.0 24 [r4]int g0/0/1 [r4-GigabitEthernet0/0/1]rip metricin ip-prefix aa 5 [r4]ip ip-prefix bb permit 192.168.13.0 24 [r4]int g0/0/0 [r4-GigabitEthernet0/0/0]rip metricin ip-prefix bb 5
标签:r1,r2,r3,HCIP,192.168,实验,ip,ospf,路由 From: https://www.cnblogs.com/wxy1787880204/p/17286386.html