HCIP网络搭建实验4——5分钟学会重发布实验

实验要求

重发布

一、配地址

R1

[Huawei]sysname R1
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 1.1.1.1 32
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]ip address 12.1.1.1 24
[R1-GigabitEthernet0/0/0]interface g0/0/1
[R1-GigabitEthernet0/0/1]ip address 13.1.1.1 24

R2

[Huawei]sysname R2
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 2.2.2.2 32
[R2-LoopBack0]interface g0/0/0
[R2-GigabitEthernet0/0/0]ip address 12.1.1.2 24
[R2-GigabitEthernet0/0/0]interface g0/0/1
[R2-GigabitEthernet0/0/1]ip address 24.1.1.1 24

R3

[R3]interface LoopBack 0
[R3-LoopBack0]ip address 3.3.3.3 32
[R3-LoopBack0]interface g0/0/1
[R3-GigabitEthernet0/0/1]ip address 13.1.1.2 24
[R3-GigabitEthernet0/0/1]interface g0/0/0 
[R3-GigabitEthernet0/0/0]ip address 34.1.1.1 24

R4

[R4]interface LoopBack 0
[R4-LoopBack0]ip address 4.4.4.4 32
[R4-LoopBack0]interface g0/0/0
[R4-GigabitEthernet0/0/0]ip address 24.1.1.2 24
[R4-GigabitEthernet0/0/0]interface g0/0/1
[R4-GigabitEthernet0/0/1]ip address 34.1.1.2 24

RIP协议

R1

[R1]rip 1  
[R1-rip-1]version 2
[R1-rip-1]network 12.0.0.0

[R1-rip-1]network 1.0.0.0
[R1-rip-1]network 13.0.0.0 

R2

[R2]rip 1
[R2-rip-1]version 2
[R2-rip-1]network 12.0.0.0
[R2-rip-1]network 2.0.0.0
[R2-rip-1]q
[R2]osp    
[R2]ospf 1 router-id 2.2.2.2
[R2-ospf-1]area 0
[R2-ospf-1-area-0.0.0.0]network 24.1.1.1 0.0.0.0

R3

[R3]rip 1
[R3-rip-1]version 2
[R3-rip-1]network 13.0.0.0
[R3-rip-1]q
[R3]ospf 1 router-id 3.3.3.3
[R3-ospf-1]area 0
[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]network 34.1.1.1 0.0.0.0

R4

[R4]ospf 1 router-id 4.4.4.4
[R4-ospf-1]area 0
[R4-ospf-1-area-0.0.0.0]network 0.0.0.0 255.255.255.255

R2重发布

[R2]rip 1
[R2-rip-1]import-route ospf 1
[R2-rip-1]q
[R2]ospf 1
[R2-ospf-1]import-route rip 1

R3重发布 

[R3]ospf 1
[R3-ospf-1]import-route rip 1
[R3-ospf-1]q
[R3]rip 1
[R3-rip-1]import-route ospf 1

在R4上查看路由表

抓取流量

R1

[R1]acl 2000 
[R1-acl-basic-2000]rule permit source 3.3.3.3 0.0.0.0
[R1-acl-basic-2000]q
[R1]interface g0/0/0
[R1-GigabitEthernet0/0/0]rip metricin 2000 3

路由策略

R1

[R1]ip ip-prefix xx deny 24.1.1.0 24
[R1]ip ip-prefix xx permit 0.0.0.0 0 less-equal 32
[R1]rip 1
[R1-rip-1]filter-policy ip-prefix xx import g0/0/1

R2

[R2]ip ip-prefix xx permit 34.1.1.0 24
[R2]route-policy hcip deny node 10
[R2-route-policy]if-match ip-prefix xx
[R2-route-policy]q
[R2]route-policy hcip permit node 20
[R2-route-policy]q
[R2]rip 1
[R2-rip-1]import-route ospf 1 route-policy hcip

R3

[R3]ip ip-prefix xx permit 2.2.2.2 32
[R3]route-policy yy permit node 10
[R3-route-policy]if-match ip-prefix xx
[R3-route-policy]apply cost 5
[R3-route-policy]q
[R3]route-policy yy permit node 20
[R3-route-policy]q
[R3]ospf 1
[R3-ospf-1]import-route rip 1 route-policy  yy

R3

[R3]ip ip-prefix nn permit 12.1.1.0 24
[R3]route-policy mm permit node 10
[R3-route-policy]if-match ip-prefix nn 
[R3-route-policy]apply tag 1
[R3-route-policy]q
[R3]route-policy mm permit node 20
[R3-route-policy]q
[R3-ospf-1]import-route rip 1 route-policy mm

R4

[R4]route-policy mm permit node 10
[R4-route-policy]if-match tag 5
[R4-route-policy]q
[R4]route-policy nn permit node 20
[R4-route-policy]q
[R4]ospf 1
[R4-ospf-1]filter-policy route-policy mm import 

实验结束

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值