任务:
1.R1上有两个环回,分别为192.168.1.0/24&192.168.2.0/24,只允许学到汇总&1.0
2.R7上有两个环回172.16.1.0/24&172.16.2.0/24,要求全部宣告,但是只有2.0可以通过
3.全网可达
拓扑图如下:
以R1为例,R2~R7同理
interface LoopBack 0
ip address 1.1.1.1 32
interface GigabitEthernet 0/0/0
ip address 12.1.1.1 24
interface LoopBack 1
ip address 192.168.1.1 24
interface LoopBack 2
ip address 192.168.2.1 24
以R1为例,R2同理
rip 1
versiong 2
network 12.0.0.0
network 1.0.0.0
network 192.168.1.0
network 192.168.2.0
以R3为例,R4~R7同理
ospf 1 router-id 3.3.3.3
area 0
network 3.3.3.3 0.0.0.0
network 34.1.1.1 0.0.0.0
以R1为例,R2~R7同理
bgp 100
router-id 1.1.1.1
peer 2.2.2.2 as-number 100
peer 2.2.2.2 connect-interface LoopBack 0
R2
import-route rip 1
R3,R5同理
import-route ospf 1
R6
import-route ospf 2
R3
peer 5.5.5.5 next-hop-local
R5
peer 3.3.3.3 next-hop-local
R6
peer 7.7.7.7 next-hop-local
R2
peer 1.1.1.1 next-hop-local
R2
ip ip-prefix xx permit 192.168.1.0 24
route-policy yy permit node 10
if-match ip-prefix xx
quit
bgp 100
aggregate 192.168.0.0 22 detail-suppressed suppress-policy yy
R6
ip ip-prefix xx permit 172.16.1.1 32
route-policy yy deny node 10
if-match ip-prefix xx
quit
route-policy yy deny node 20
quit
bgp 102
peer 56.1.1.1 route-policy yy export