一,拓扑图
二,需求
-
整张网络使用192.168.1.0/24网段进行划分
-
R1、R2、R3、R4均有两个环回来模拟用户网段
-
R5使用DHCP为PC分配IP地址
-
R2、R3、R4、R5开启Telnet功能;账号密码:admin/admin
-
使用R1进行Telnet测试登录其他设备
-
完成所有路由器的静态路由配置,要求使用最简化路由表的方式
-
全网可达
-
R4、R5中一条线路为1000M,一条为10M
三,需求分析
1.确定需要网段数、由192.168.1.0/24划分15个网段。
2.为各个路由器接口添加对应网段IP地址
3.为R1、R2、R3、R4分别创建两个环回接口
4.R5作为DHCP服务器为PC1和PC2分配IP地址
5.R2、R3、R4、R5作为Telnet客户端R1的Telnet服务器,实现R1登录Telnet服务器
6.实现全网可达,Telnet登录实现,需要进行路由器的静态路由配置
7.R4、R5中上面一条为1000M优先级高,下面一条为10M优先级低,通过更改Pre数值实现
四、配置过程
1.网段划分:
192.168.1.0/24
192.168.1.000 00000---192.168.1.0/27---骨干
192.168.1.000 000 00----192.168.1.0/30---192.168.1.1~1.2
192.168.1.000 001 00----192.168.1.4/30---192.168.1.5~1.6
192.168.1.000 010 00----192.168.1.8/30
192.168.1.000 011 00----192.168.1.12/30
192.168.1.000 100 00----192.168.1.16/30
192.168.1.000 101 00----192.168.1.20/30
192.168.1.000 110 00----192.168.1.0/30
192.168.1.000 111 00----192.168.1.0/30
192.168.1.001 00000---192.168.1.32/27---R1环回
192.168.1.001 0 0000---192.168.1.32/28
192.168.1.001 1 0000---192.168.1.48/28
192.168.1.010 00000---192.168.1.64/27---R2环回
192.168.1.010 0 0000---192.168.1.64/28
192.168.1.010 1 0000---192.168.1.80/28
192.168.1.011 00000---192.168.1.96/27---R3环回
192.168.1.011 0 0000---192.168.1.96/28
192.168.1.011 1 0000---192.168.1.112/28
192.168.1.100 00000---192.168.1.128/27---R4环回
192.168.1.100 0 0000---192.168.1.128/28
192.168.1.100 1 0000---192.168.1.144/28
192.168.1.101 00000---192.168.1.160/27---
192.168.1.110 00000
192.168.1.111 00000
2.配置接口IP地址:
1.R1接口:
<Huawei>sys
[Huawei]sysname R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/0]q
[R1]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
2.R2接口:
<Huawei>sys
[Huawei]sysname R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2-GigabitEthernet0/0/0]q
[R2]int g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
3.R3接口:
<Huawei>sys
[Huawei]sysname R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R3-GigabitEthernet0/0/0]q
[R3]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
4.R4接口:
<Huawei>sys
[Huawei]sysname R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[R4-GigabitEthernet0/0/0]q
[R4]int g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[R4-GigabitEthernet0/0/1]q
[R4]int g0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.21 30
[R4-GigabitEthernet0/0/2]q
[R4]int g4/0/0
[R4-GigabitEthernet4/0/0]ip address 192.168.1.17 30
5.R5接口:
<Huawei>sys
[Huawei]sysname R5
[R5]int g0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.161 27
[R5-GigabitEthernet0/0/1]q
[R5]int g0/0/2
[R5-GigabitEthernet0/0/2]ip address 192.168.1.22 30
[R5-GigabitEthernet0/0/2]q
[R5]int g4/0/0
[R5-GigabitEthernet4/0/0]ip address 192.168.1.18 30
3.回环接口:
R1:
[R1]int LoopBack 0
[R1-LoopBack0]ip ad 192.168.1.33 28
[R1]int l 1
[R1-LoopBack1]ip ad 192.168.1.49 28
R2:
[R2opBack0]ip ad 192.168.1.65 28
[R2LoopBack1]ip ad 192.168.1.81 28
R3:
[R3-LoopBack0]ip ad 192.168.1.97 28
[R3-LoopBack1] ip ad 192.168.1.113 28
R4:
[R4-LoopBack0]ip ad 192.168.1.129 28
[R4-LoopBack1]ip ad 192.168.1.145 28
4.DHCP为pc分配IP地址:
[R5]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done
[R5] ip pool a
Info: It's successful to create an IP address pool.
[R5-ip-pool-a]network 192.168.1.160 mask 27
[R5-ip-pool-a]gateway-list 192.168.1.161
[R5-ip-pool-a]dns-list 8.8.8.8
[R5-ip-pool-a]q
[R5]int GigabitEthernet 0/0/1
[R5-GigabitEthernet0/0/1]dhcp select global
5.Telnet;账号admin密码:123456
1.R2服务器配置
[R2]user-interface vty 0 4
[R2-ui-vty0-4]authentication-mode aaa
[R2-ui-vty0-4]q
[R2]aaa
[R2-aaa]local-user admin password cipher 123456
[R2-aaa]local-user admin privilege level 15
[R2-aaa]local-user admin service-type telnet
2.R3服务器配置
[R3]user-interface vty 0 4
[R3-ui-vty0-4]authentication-mode aaa
[R3-ui-vty0-4]q
[R3]aaa
[R3-aaa]local-user admin password cipher 123456
[R3-aaa]local-user admin privilege level 15
[R3-aaa]local-user admin service-type telnet
3.R4服务器配置
[R4]user-interface vty 0 4
[R4-ui-vty0-4]authentication-mode aaa
[R4-ui-vty0-4]q
[R4]aaa
[R4-aaa]local-user admin password cipher 123456
[R4-aaa]local-user admin privilege level 15
[R4-aaa]local-user admin service-type telnet
4.R5服务器配置
[R5]user-interface vty 0 4
[R5-ui-vty0-4]authentication-mode aaa
[R5-ui-vty0-4]q
[R5]aaa
[R5-aaa]local-user admin password cipher 123456
[R5-aaa]local-user admin privilege level 15
[R5-aaa]local-user admin service-type telnet
6.静态路由
1.R1静态路由配置
[R1]ip route-static 192.168.1.32 28 192.168.1.2
[R1]ip route-static 192.168.1.64 28 192.168.1.2
[R1]ip route-static 192.168.1.48 28 192.168.1.18
[R1]ip route-static 192.168.1.80 28 192.168.1.18
[R1]ip route-static 192.168.1.96 28 192.168.1.18
2.R2静态路由配置
[R2]ip route-static 192.168.1.4 30 192.168.1.1
[R2]ip route-static 192.168.1.12 30 192.168.1.10
[R2]ip route-static 192.168.1.32 30192.168.1.1
[R2]ip route-static 192.168.1.96 30 192.168.1.1
[R2]ip route-static 192.168.1.128 30 192.168.1.10
3.R3静态路由配置
[R3]ip route-static 192.168.1.0 30 192.168.1.5
[R3]ip route-static 192.168.1.8 30 192.168.1.14
[R3]ip route-static 192.168.1.32 30 192.168.1.5
[R3]ip route-static 192.168.1.64 30 192.168.1.5
[R3]ip route-static 192.168.1.128 30 192.168.1.14
4.R4静态路由配置
[R4]ip route-static 192.168.1.0 30 192.168.1.9
[R4]ip route-static 192.168.1.4 30 192.168.1.9
[R4]ip route-static 192.168.1.32 30 192.168.1.9
[R4]ip route-static 192.168.1.64 30 192.168.1.13
5.R5静态路由配置(使用缺省路由)
[R1]ip route-static 0.0.0.0 0 192.168.1.2
[R1]ip route-static 0.0.0.0 0 192.168.1.6
[R2]ip route-static 0.0.0.0 0 192.168.1.1
[R3]ip route-static 0.0.0.0 0 192.168.1.14
[R4]ip route-static 0.0.0.0 0 192.168.1.18
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[R5]ip route-static 192.168.1.4 30 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.32 27 192.168.1.17
[R5]ip route-static 192.168.1.64 27 192.168.1.17
[R5]ip route-static 192.168.1.96 27 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.17
6.实现简化路由
对R1:
[R1]undo ip route-static 192.168.1.128 27 192.168.1.2
[R1]undo ip route-static 192.168.1.128 27 192.168.1.6
对R2:
[R2]undo ip route-static 192.168.1.128 27 192.168.1.10
对R3:
[R3]undo ip route-static 192.168.1.128 27 192.168.1.14
五.测试
1.PC1
2.PC2
3.R1
六.结果验证
1.Telnet登陆验证:
2.DHCP自动分配IP验证
上面进行DHCP配置说明时已给出最后结果