一、实验要求
二、实验拓扑
三、实验操作
配置IP
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]R1
^
Error: Unrecognized command found at '^' position.
[Huawei]sys r1
[r1]int g0/0/1
[r1-GigabitEthernet0/0/1]ip add 14.1.1.1 24
Aug 24 2023 15:45:18-08:00 r1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r1-GigabitEthernet0/0/1]int lo0
[r1-LoopBack0]ip add 1.1.1.1 24
[r1-LoopBack0]int g0/0/0
[r1-GigabitEthernet0/0/0]ip add 12.1.1.1 24
Aug 24 2023 15:45:52-08:00 r1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r1-GigabitEthernet0/0/0]q
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip add 12.1.1.2 24
Aug 24 2023 15:46:51-08:00 r2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r2-GigabitEthernet0/0/0]int g0/0/1
[r2-GigabitEthernet0/0/1]ip add 13.1.1.1 24
Aug 24 2023 15:47:08-08:00 r2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r2-GigabitEthernet0/0/1]int lo0
[r2-LoopBack0]ip add 2.2.2.2 24
[r2-LoopBack0]q
[r2]
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip add 23.1.1.2 24
Aug 24 2023 15:48:09-08:00 r3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int g0/0/1
[r3-GigabitEthernet0/0/1]ip add 34.1.1.1 24
Aug 24 2023 15:48:26-08:00 r3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r3-GigabitEthernet0/0/1]int lo0
[r3-LoopBack0]ip add 3.3.3.3 24
[r3-LoopBack0]q
[r3]
The device is running!
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r4
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip add 14.1.1.2 24
Aug 24 2023 15:49:30-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r4-GigabitEthernet0/0/1]int g0/0/0
[r4-GigabitEthernet0/0/0]ip add 34.1.1.2 24
Aug 24 2023 15:49:47-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r4-GigabitEthernet0/0/0]int lo0
[r4-LoopBack0]ip add 4.4.4.4 24
[r4-LoopBack0]q
[r4]
左边rip
[r1]rip 1 [r1-rip-1]version 2 [r1-rip-1]net [r1-rip-1]network 1.0.0.0 [r1-rip-1]net [r1-rip-1]network 12.0.0.0 [r1-rip-1]net [r1-rip-1]network 14.0.0.0 [r1-rip-1]
[r2]rip 1 [r2-rip-1]versi [r2-rip-1]version 2 [r2-rip-1]net [r2-rip-1]network 12.0.0.0 [r2-rip-1]net [r2-rip-1]network 2.0.0.0 [r2-rip-1]
[r4]rip 1 [r4-rip-1]ver [r4-rip-1]vers [r4-rip-1]version 2 [r4-rip-1]net [r4-rip-1]network 14.0.0.0 [r4-rip-1]
右边ospf
[r2]ospf 1 rou [r2]ospf 1 router-id 2.2.2.2 [r2-ospf-1]a 0 [r2-ospf-1-area-0.0.0.0]net [r2-ospf-1-area-0.0.0.0]network 23.1.1.1 0.0.0.0 [r2-ospf-1-area-0.0.0.0]
[r3]ospf 1 rout [r3]ospf 1 router-id 3.3.3.3 [r3-ospf-1]a 0 [r3-ospf-1-area-0.0.0.0]net [r3-ospf-1-area-0.0.0.0]network 3.3.3.3 0.0.0.0 [r3-ospf-1-area-0.0.0.0]net [r3-ospf-1-area-0.0.0.0]network 23.1.1.2 0.0.0.0 [r3-ospf-1-area-0.0.0.0]net [r3-ospf-1-area-0.0.0.0]network 34.1.1.1 0.0.0.0 [r3-ospf-1-area-0.0.0.0]
[r4]ospf 1 rout [r4]ospf 1 router-id 4.4.4.4 [r4-ospf-1]a 0 [r4-ospf-1-area-0.0.0.0]net [r4-ospf-1-area-0.0.0.0]network 4.4.4.4 0.0.0.0 [r4-ospf-1-area-0.0.0.0]net [r4-ospf-1-area-0.0.0.0]network 34.1.1.2 0.0.0.0 [r4-ospf-1-area-0.0.0.0]q [r4-ospf-1]int lo0 [r4-LoopBack0]ospf net [r4-LoopBack0]ospf network-type bro [r4-LoopBack0]ospf network-type broadcast [r4-LoopBack0]
配置多点双向重发布,调用接口抓取流量,启用策略
R1
[r1]int g0/0/0 [r1-GigabitEthernet0/0/0]rip m [r1-GigabitEthernet0/0/0]rip metricin ip-p [r1-GigabitEthernet0/0/0]rip metricin ip-prefix 4 2 [r1-GigabitEthernet0/0/0]int g0/0/1 [r1-GigabitEthernet0/0/1]rip metricin ip-prefix 3 2 [r1-GigabitEthernet0/0/1]q //对要抓取的流量进行定义 [r1]ip ip-p [r1]ip ip-prefix 4 in [r1]ip ip-prefix 4 index 10 p [r1]ip ip-prefix 4 index 10 permit 4.4.4.0 24 [r1]ip ip-prefix 4 index 20 permit 34.1.1.0 24 [r1]ip ip-prefix 4 index 10 permit 23.1.1.0 24 [r1]
R2
[r2-ospf-1]imp [r2-ospf-1]import-route rip //重发布 [r2-ospf-1]q //修改流量属性 [r2]ospf 1 [r2-ospf-1]import-route rip 1 route-policy aa [r2-ospf-1]route-policy aa permit node 10 Info: New Sequence of this List. [r2-route-policy]if-match ip-prefix aa [r2-route-policy]apply cost-type type-1 [r2-route-policy]route-policy aa permit node 20 Info: New Sequence of this List. [r2-route-policy]if-match ip-prefix aa [r2-route-policy]apply cost-type type-1 [r2-route-policy] //空列表 [r2-route-policy]route-policy aa permit node 50 Info: New Sequence of this List. [r2-route-policy] [r2-route-policy]q //对要抓取的流量进行定义 [r2]ip ip-p [r2]ip ip-prefix aa ind [r2]ip ip-prefix aa index 10 per [r2]ip ip-prefix aa index 10 permit 2.2.2.0 24 [r2]ip ip-p [r2]ip ip-prefix aa in [r2]ip ip-prefix aa index 20 per [r2]ip ip-prefix aa index 20 permit 12.1.1.0 24 [r2]
R3
r4]rip 1 [r4-rip-1]imp [r4-rip-1]import-route ospf 1 //重发布 [r4-rip-1]q [r4]ip ip-prefix aa permit 14.1.1.0 24 //定义抓取的流量 [r4]route-policy aa permit node 10 Info: New Sequence of this List. [r4-route-policy]if-match ip-prefix aa [r4-route-policy]apply cost-type type-1 //修改流量属性 [r4-route-policy]q [r4]route-policy aa permit node 50 //空列表 Info: New Sequence of this List. [r4-route-policy] [r4-route-policy]q [r4]ospf 1 [r4-ospf-1]import-route rip route-policy aa [r4-ospf-1]q [r4]
四、实验检测
命令shutdown关闭路由器2,3间通路