要求:
配置:
- 配置IP地址:
Ar1:
[a1]int g 0/0/0
[a1-GigabitEthernet0/0/0]ip add 100.1.1.1 24
[a1-GigabitEthernet0/0/0]int l 0
[a1-LoopBack0]ip add 192.168.0.1 32
[a1-LoopBack0]int l1
[a1-LoopBack1]ip add 192.168.1.1 32
Ar2:
[a2]int g 0/0/0
[a2-GigabitEthernet0/0/0]ip add 100.1.1.2 24
[a2-GigabitEthernet0/0/0]int g 0/0/1
[a2-GigabitEthernet0/0/1]ip add 100.2.2.2 24
Ar3:
[a3]int g 0/0/0
[a3-GigabitEthernet0/0/0]ip add 100.2.2.3 24
[a3-GigabitEthernet0/0/0]int g 0/0/1
[a3-GigabitEthernet0/0/1]ip add 100.3.3.3 24
[a3-GigabitEthernet0/0/1]int l0
[a3-LoopBack0]ip add 192.168.2.1 32
[a3-LoopBack0]int l1
[a3-LoopBack1]ip add 192.168.3.1 32
Ar4:
[a4]int g0/0/0
[a4-GigabitEthernet0/0/0]ip add 100.3.3.4 24
[a4-GigabitEthernet0/0/0]int l0
[a4-LoopBack0]ip add 192.168.4.1 32
[a4-LoopBack0]int l1
[a4-LoopBack1]ip add 192.168.5.1 32
- 启动动态路由:
Rip:
Ar1:
[a1]rip
[a1-rip-1]v 2
[a1-rip-1]network 192.168.0.1
[a1-rip-1]network 192.168.0.0
[a1-rip-1]network 192.168.1.0
[a1-rip-1]net 100.0.0.0
Ar2:
[a2]rip
[a2-rip-1] v 2
[a2-rip-1]net 100.0.0.0
Ospf:
Ar2:
[a2]ospf
[a2-ospf-1]area 0
[a2-ospf-1-area-0.0.0.0]network 100.2.2.0 0.0.0.255
Ar3:
[a3]ospf
[a3-ospf-1]area 0
[a3-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.255.255
[a3-ospf-1-area-0.0.0.0]net 100.2.2.0 0.0.0.255
[a3-ospf-1]area 1
[a3-ospf-1-area-0.0.0.1]net 100.3.3.0 0.0.0.255
Ar4:
[a4]ospf
[a4-ospf-1]area 1
[a4-ospf-1-area-0.0.0.1]net 100.3.3.0 0.0.0.255
[a4-ospf-1-area-0.0.0.1]net 192.168.0.0 0.0.255.255
内网中互通情况:
- 配置双向路由重发布:
[a2]ip ip-prefix ot4 permit 192.168.4.1 32
[a2]ip ip-prefix ot4 permit 192.168.5.1 32
[a2]route-policy aa deny node 10
[a2-route-policy]if-match ip-prefix ot4
[a2]route-policy aa permit node 20
[a2-ospf-1]import-route rip
[a2-rip-1]import-route ospf route-policy aa
效果图:
配置ip-perfix拒绝r1:
抓取目标网段:
[a4]ip ip-prefix 4t1 deny 192.168.0.1 32
[a4]ip ip-prefix 4t1 deny 192.168.1.1 32
[a4]ip ip-prefix 4t1 permit 0.0.0.0 0 less-equal 32
调用过滤列表:
[a4-ospf-1]filter-policy ip-prefix 4t1 import
效果图:
要求5:
[a2-rip-1]silent-interface g 0/0/1