![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/3c6c54332e43f9fd9e35f94336c418ef.png#pic_center)
1.如图配置IP
2.配置RIP/OSPF
[r1]rip 1
[r1]version 2
[r1]network 1.0.0.0
[r1]network 12.0.0.0
[r1]network 13.0.0.0
[r2]rip 1
[r2]version 2
[r2]network 2.0.0.0
[r2]network 12.0.0.0
[r2]ospf 1 router-id 2.2.2.2
[r2]area 0
[r2]network 24.0.0.1 0.0.0.0
[r3]rip 1
[r3]version 2
[r3]network 13.0.0.0
[r3]ospf 1 router-id 3.3.3.3
[r3]area 0
[r3]network 3.3.3.3 0.0.0.0
[r3]network 34.0.0.1 0.0.0.0
[r4]ospf 1 router-id 4.4.4.4
[r4]area 0
[r4]network 4.4.4.4 0.0.0.0
[r4]network 34.0.0.2 0.0.0.0
[r4]network 24.0.0.2 0.0.0.0
配置双向重发布
[r2]ospf
[r2-ospf-1]import-route rip
[r2-ospf-1]q
[r2]rip
[r2-rip-1]import-route ospf
[r3]ospf
[r3-ospf-1]import-route rip
[r3-ospf-1]q
[r3]rip
[r3-rip-1]import-route ospf
更改接口类型
[r2]int LoopBack 0
[r2-LoopBack0]ospf network-type broadcast
[r3]int l 0
[r3-LoopBack0]ospf network-type broadcast
抓取流量
[r1]ip ip-prefix aaa permit 3.3.3.0 24
[r1]interface GigabitEthernet 0/0/0
[r1]rip metricin ip-prefix aaa 5
[r1]ip ip-prefix bbb permit 34.0.0.0 24
[r1]interface GigabitEthernet 0/0/0
[r1]rip metricin ip-prefix bbb 5
[r1]ip ip-prefix ccc permit 24.0.0.0 24
[r1]interface GigabitEthernet 0/0/1
[r1]rip metricin ip-prefix ccc 5