拓扑图及分析
实验需求在这里插入图片描述
1、整张网络使用192.168.1.0/24网段进行划分
2、R1、R2、R3、R4均有两个环回来模拟用户网段
3、R5使用DHCP为PC分配IP地址
4、R2、R3、R4、R5开启Telnet功能;账号密码:admin/admin;
并且使用R1进行Telnet测试登录其他设备
5.完成所有路由器的静态路由配置,要求使用最简化路由表的方式
6、全网可达
需求分析
1.全网同一网段,因此需要划分IP,并将相应IP对应设备进行分配。
2.配置缺省路由,实现全网通,并测试
3.防环,做黑洞路由配置
4.配置浮动静态路由
基础配置
端口配置
配置AR1
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.9 30
环回接口
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 192.168.1.33 28
[Huawei]int LoopBack 1
[Huawei-LoopBack1]ip add 192.168.1.49 28
配置AR2
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.5 30
环回接口
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 192.168.1.65 28
[Huawei]int LoopBack 1
[Huawei-LoopBack1]ip add 192.168.1.81 28
配置AR3
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.10 30
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.13 30
环回接口
[Huawei]int LoopBack 0
[Huawei-LoopBack0]ip add 192.168.1.97 28
[Huawei]int LoopBack 1
[Huawei-LoopBack1]ip add 192.168.1.113 28
配置AR4
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip address 192.168.1.21 30
[Huawei]int g4/0/0
[Huawei-GigabitEthernet4/0/0]ip address 192.168.1.17 30
环回接口
[Huawei]interface LoopBack 0
[Huawei-LoopBack0]ip address 192.168.1.129 28
[Huawei]interface LoopBack 1
[Huawei-LoopBack1]ip address 192.168.1.145 28
配置AR5
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.18 30
[Huawei-GigabitEthernet0/0/0]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.22 30
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 192.168.1.161 27
手工补齐静态路由表
AR1
[Huawei]ip route-static 192.168.1.4 30 192.168.1.2
[Huawei]ip route-static 192.168.1.12 30 192.168.1.10
[Huawei]ip route-static 192.168.1.64 27 192.168.1.2
[Huawei]ip route-static 192.168.1.96 27 192.168.1.10
AR2
[Huawei]ip route-static 192.168.1.96 27 192.168.1.1
[Huawei]ip route-static 192.168.1.96 27 192.168.1.6
[Huawei]ip route-static 192.168.1.32 27 192.168.1.1
[Huawei]ip route-static 192.168.1.128 27 192.168.1.6
[Huawei]ip route-static 192.168.1.8 30 192.168.1.1
[Huawei]ip route-static 192.168.1.12 30 192.168.1.4
AR3
[Huawei]ip route-static 192.168.1.64 27 192.168.1.9
[Huawei]ip route-static 192.168.1.64 27 192.168.1.14
[Huawei]ip route-static 192.168.1.128 27 192.168.1.14
[Huawei]ip route-static 192.168.1.32 27 192.168.1.9
[Huawei]ip route-static 192.168.1.0 30 192.168.1.9
[Huawei]ip route-static 192.168.1.4 30 192.168.1.14
AR4
[Huawei]ip route-static 192.168.1.32 27 192.168.1.5
[Huawei]ip route-static 192.168.1.32 27 192.168.1.13
[Huawei]ip route-static 192.168.1.8 30 192.168.1.13
[Huawei]ip route-static 192.168.1.0 30 192.168.1.4
[Huawei]ip route-static 192.168.1.0 30 192.168.1.5
[Huawei]ip route-static 192.168.1.96 27 192.168.1.5
浮动静态路由 AR4
[Huawei]ip route-static 192.168.1.160 27 192.168.1.22 permanent
[Huawei]ip route-static 192.168.1.160 27 192.168.1.22 preference 61
浮动静态路由 AR5
[Huawei]ip route-static 192.168.1.0 24 192.168.1.21 permanent
[Huawei]ip route-static 192.168.1.0 24 192.168.1.21 preference 61
缺省路由配置 AR1
[Huawei]ip route-static 0.0.0.0 0 192.168.1.2
[Huawei]ip route-static 0.0.0.0 0 192.168.1.10
AR2
[Huawei]ip route-static 0.0.0.0 0 192.168.1.6
AR3
[Huawei]ip route-static 0.0.0.0 0 192.168.1.14
防环,黑洞路由配置
AR1
[Huawei]ip route-static 192.168.1.64 27 NULL 0
[Huawei]ip route-static 192.168.1.96 27 NULL 0
AR2
[Huawei]ip route-static 192.168.1.96 27 NULL 0
[Huawei]ip route-static 192.168.1.128 27 NULL 0
[Huawei]ip route-static 192.168.1.32 27 NULL 0
AR3
[Huawei]ip route-static 192.168.1.32 27 NULL 0
[Huawei]ip route-static 192.168.1.64 27 NULL 0
[Huawei]ip route-static 192.168.1.128 27 NULL 0
AR4
[Huawei]ip route-static 192.168.1.32 27 NULL 0
[Huawei]ip route-static 192.168.1.64 27 NULL 0
AR5
[Huawei]ip route-static 192.168.1.0 24 NULL 0
Telnet远程登录
AR2
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode aaa
[Huawei]aaa
[Huawei-aaa]local-user admin password cipher admin privilege level 15
AR3
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode aaa
[Huawei]aaa
[Huawei-aaa]local-user admin password cipher admin privilege level 15
AR4
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode aaa
[Huawei]aaa
[Huawei-aaa]local-user admin password cipher admin privilege level 15
AR1—登录端
<Huawei>telnet 192.168.1.2
Press CTRL_] to quit telnet mode
Trying 192.168.1.2 ...
Connected to 192.168.1.2 ...
Login authentication
Username:admin
Password:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys jia
[jia]
通过DHCP给PC端分配地址
AR5
[Huawei]dhcp en
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]ip pool jia1
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-jia1]network 192.168.1.160 mask 27
[Huawei-ip-pool-jia1]gateway-list 192.168.1.161
[Huawei-ip-pool-jia1]dns-list 8.8.8.8
[Huawei]int g0/0/2
[Huawei-GigabitEthernet0/0/2]dhcp select global
PC
打开DHCP,并在 命令行内通过ipconfig进行确认
结果
测试是否设备之间全部联通,可通过ping指令进行测试
查看配置的静态路由表
display ip routing-table protocol static