需求:
R1 - R2 - R3 - R4 - R5 运行RIPV2
R6 - R7 运行RIPV1
1、使用合理IP地址规划网络,各种创建环回接口
2、R1创建环回172.16.1.1/24 172.16.2.1/24 172.16.3.1/24
3、要求R3使用R2访问R1环回
4、减少路由条目数量,增加路由传递安全性
5、R5创建一个环回模拟运营商,不能宣告
6、R1 telnet R2环回实际telnet到R7上
7、R6 - R7路由器不能学习到达R1环回路由
8、全网可达
IP地址规划
各自环回:
R1:1.1.1.0/24 R2:2.2.2.0/24 R3:3.3.3.0/24
R4:4.4.4.0/24 R5:5.5.5.0/24 R6:6.6.6.0/24
R7:7.7.7.0/24 R1额外三个环回上图标注
接口IP【以设备号为规律】配置如下
【R1配置】
sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 12.0.0.1 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 14.0.0.1 24
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip address 1.1.1.1 24
[Huawei-LoopBack0]int l1
[Huawei-LoopBack1]ip address 172.16.1.1 24
[Huawei-LoopBack1]int l2
[Huawei-LoopBack2]ip address 172.16.2.1 24
[Huawei-LoopBack2]int l3
[Huawei-LoopBack3]ip address 172.16.3.1 24
【R2配置】
sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 12.0.0.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 23.0.0.1 24
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip address 2.2.2.2 24
【R3配置】
sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 23.0.0.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 34.0.0.1 24
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip address 3.3.3.3 24
【R4配置】
sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 14.0.0.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 34.0.0.2 24
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip address 45.0.0.1 24
[Huawei-GigabitEthernet0/0/2]int g4/0/0
[Huawei-GigabitEthernet4/0/0]ip address 46.0.0.1 24
[Huawei-GigabitEthernet4/0/0]int l0
[Huawei-LoopBack0]ip address 4.4.4.4 24
【R5配置】
sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 45.0.0.2 24
[Huawei-GigabitEthernet0/0/0]int l0
[Huawei-LoopBack0]ip address 5.5.5.5 24
【R6配置】
sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 46.0.0.2 24
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 67.0.0.1 24
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip add
[Huawei-LoopBack0]ip address 6.6.6.6 24
【R7配置】
sys
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 67.0.0.2 24
[Huawei-GigabitEthernet0/0/0]int l0
[Huawei-LoopBack0]ip address 7.7.7.7 24
【R1 2 3 4 5rip配置】
[r1]rip
[r1-rip-1]v 2
【宣告直连】
[r1-rip-1]network 12.0.0.0
[r1-rip-1]network 14.0.0.0
【宣告环回】R5有要求不宣告环回
[r1-rip-1]network 1.0.0.0
[r1-rip-1]network 172.16.0.0
【R6 7rip配置】
[r6]rip
[r6-rip-1]v 1
【宣告直连】
[r6-rip-1]network 46.0.0.0
[r6-rip-1]network 67.0.0.0
【宣告环回】
[r6-rip-1]network 6.0.0.0
策略满足需求:
3、要求R3使用R2访问R1环回
4、减少路由条目数量,增加路由传递安全性
R3到R1目前是负载均衡,先满足4进行子网汇总
172.16.1.0/24 172.16.2.0/24 172.16.3.0/24
汇总为172.16.0.0/22
【两端都要汇总,V2带子网掩码,会认为是两条不同的】
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]rip summary-address 172.16.0.0 255.255.252.0
[r1-GigabitEthernet0/0/0]int g0/0/1
[r1-GigabitEthernet0/0/1]rip summary-address 172.16.0.0 255.255.252.0
【汇总之后配上空接口,防环】
[r1]ip route-static 172.16.0.0 22 n 0
现在去R3对入方向流量进行限制
[r3]acl 2000
[r3-acl-basic-2000]rule permit source 172.16.0.0 0
[r3-acl-basic-2000]rule permit source 1.1.1.0 0
[r3-acl-basic-2000]q
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]rip metricin 2000 2【代表路由表条目开销值加2】
4增加安全性 -- 到接口上做认证
[r1]int g0/0/0
[r1-GigabitEthernet0/0/0]rip authentication-mode ?
hmac-sha256
md5 MD5 authentication 【几种认证模式】
simple Simple authentication
[r1-GigabitEthernet0/0/0]rip authentication-mode md5 ?
nonstandard Nonstandard MD5 authentication packet format (IETF)【非标】
usual Huawei MD5 authentication packet format【标准】
[r1-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456【设置明文密文存储】
【接下来去对端设置一样的】
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]rip authentication-mode md5 usual cipher 123456
【usual是和上边对应 然后明文密文本地显示,可以不一样 但是口令必须一样】
8、全网可达 -- V1 V2互通
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]rip version 2
【让R6能同时获取V1 V2的路由信息】
5、R5创建一个环回模拟运营商
【在运营商处写缺省】
[r5]rip
[r5-rip-1]default-route originate
7、R6 - R7路由器不能学习到达R1环回路由 -- 路由过滤
[r6]acl 2000
[r6-acl-basic-2000]rule deny source 172.16.0.0 0
[r6-acl-basic-2000]rule deny source 1.1.1.0 0
[r6-acl-basic-2000]rule permit source any
6、R1 telnet R2环回实际telnet到R7上
[r7]aaa
[r7-aaa]local-user admin privilege level 15 password cipher 123456
[r7-aaa]local-user admin service-type telnet
[r7-aaa]q
[r7]user-interface vty 0 4【开启虚拟端口】
[r7-ui-vty0-4]authentication-mode aaa
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]nat server protocol tcp global interface loopback 0 23
inside 7.7.7.7 23
Warning:The port 23 is well-known port. If you continue it may cause function fa
ilure.
Are you sure to continue?[Y/N]:y
【流量方向要控制所以R2处的负载均衡需要进行路由控制】
[r2]acl 2000
[r2-acl-basic-2000]rule permit source 7.0.0.0 0
[r2-acl-basic-2000]q
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]rip metricin 2000 10
【这里用的都是入方向控制】
[r4]acl 2000
[r4-acl-basic-2000]rule permit source 12.0.0.0 0
[r4-acl-basic-2000]q
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]rip metricin 2000 10
【成功】
telnet 2.2.2.2
Press CTRL_] to quit telnet mode
Trying 2.2.2.2 ...
Connected to 2.2.2.2 ...
Login authentication
Username:
Username or Domain invalid!
Username:admin
Password:
-----------------------------------------------------------------------------
User last login information:
-----------------------------------------------------------------------------
Access Type: Telnet
IP-Address : 67.0.0.1
Time : 2022-04-05 16:24:14-08:00
-----------------------------------------------------------------------------