根据要求,划分如下,整体思路
先将骨干链路作为一个网段,r1、r2、r4、r5的环回个作为一个网段,供需要1+4=5个网段
需向网络位借3位供提供8个网段取前5个,分别是:
192.168.1.0/27---作为骨干链路,再借3位共8个网段取前6个作为骨干链路的网段,如下图
192.168.1.32/27--作为r1的环回,再借1位共2个网段192.168.1.32/28和192.168.1.48/28,如下图
192.168.1.64/27--作为r2的环回,再借1位共2个网段192.168.1.64/28和192.168.1.80/28,如下图
192.168.1.96/27--作为r3的g0/0/2端口的ip,如下图
192.168.1.128/27--作为r4的环回,再借1位共2个网段192.168.1.128/28和192.168.1.144/28,如下图
192.168.1.160/27--作为r5的环回,如下图
192.168.1.160/27--作为r5的环回,如下图
首先配置修改每个设备的名称,这里以r1为例
[Huawei]sysname r1
然后给每一路由器配置ip,以r1为例
[r1]interface g0/0/0
[r1-GigabitEthernet0/0/0]ip ad
[r1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[r1]interface g0/0/1
[r1-GigabitEthernet0/0/1]ip ad
[r1-GigabitEthernet0/0/1]ip address 192.168.1.5 30
给需要环回接口的路由器配置环回接口,以r1为例
[r1]int
[r1]interface loo
[r1]interface LoopBack 0
[r1-LoopBack0]ip ad
[r1-LoopBack0]ip address 192.168.1.33 28
[r1]int
[r1]interface loo
[r1]interface LoopBack 1
[r1-LoopBack1]ip ad
[r1-LoopBack1]ip address 192.168.1.49 28
置完成后,查看路由表,以r1为例:
[r1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/30 up up
GigabitEthernet0/0/1 192.168.1.5/30 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.33/28 up up(s)
LoopBack1 192.168.1.49/28 up up(s)
NULL0 unassigned up up(s)
接着配置静态路由,配置静态路由是,先配置缺省,不符合缺省路线的再添加上,以r1为例
开启r3的dhcp服务
[r3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]ip pool aa
Info: It's successful to create an IP address pool.
[r3-ip-pool-aa]netw
[r3-ip-pool-aa]network 192.168.1.96 ma
[r3-ip-pool-aa]network 192.168.1.96 mask 27
[r3-ip-pool-aa]gat
[r3-ip-pool-aa]gateway-list 192.168.1.97
[r3-ip-pool-aa]q
[r3]int
[r3]interface g0/0/2
[r3-GigabitEthernet0/0/2]dhcp se
[r3-GigabitEthernet0/0/2]dhcp select g
[r3-GigabitEthernet0/0/2]dhcp select global
r1上开启telent服务
[r1]aaa
[r1-aaa]local
[r1-aaa]local-user admin
[r1-aaa]local-user admin pr
[r1-aaa]local-user admin privilege level 15 password ci
[r1-aaa]local-user admin privilege level 15 password cipher 123
[r1-aaa]loca
[r1-aaa]local-user ad
[r1-aaa]local-user admin ser
[r1-aaa]local-user admin service-type tel
[r1-aaa]local-user admin service-type telnet
[r1]user-interface vty 0 4
[r1-ui-vty0-4]au
[r1-ui-vty0-4]authentication-mode aaa
r5上设置端口映射
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]nat se
[r5-GigabitEthernet0/0/1]nat server pr
[r5-GigabitEthernet0/0/1]nat server protocol tcp
[r5-GigabitEthernet0/0/1]nat server protocol tcp gl
[r5-GigabitEthernet0/0/1]nat server protocol tcp global curr
[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 in
[r5-GigabitEthernet0/0/1]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 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
浮动静态路由,r4上
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 70
[r4]ip route-static 192.168.1.160 27 192.168.1.20 preference 70
[r4]ip route-static 0.0.0.0 0 GigabitEthernet 0/0/2 192.168.1.18
r5上
[r5]ip route-static 192.168.1.0 24 192.168.1.21 preference 70
空接口防环路由,以r1为例
[r1]ip route-static 192.168.1.32 27 NULL 0
测试
全网可达,用r1去Ping r6的环回
<r1>ping 1.1.1.1
PING 1.1.1.1: 56 data bytes, press CTRL_C to break
Reply from 1.1.1.1: bytes=56 Sequence=1 ttl=252 time=50 ms
Reply from 1.1.1.1: bytes=56 Sequence=2 ttl=252 time=40 ms
Reply from 1.1.1.1: bytes=56 Sequence=3 ttl=252 time=50 ms
Reply from 1.1.1.1: bytes=56 Sequence=4 ttl=252 time=40 ms
PC1和PC2DHCP服务自动获取IP
pc1
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe91:74a3
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.126
Subnet mask.......................: 255.255.255.224
Gateway...........................: 192.168.1.97
Physical address..................: 54-89-98-91-74-A3
DNS server........................:
pc2
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fe4a:4d00
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.125
Subnet mask.......................: 255.255.255.224
Gateway...........................: 192.168.1.97
Physical address..................: 54-89-98-4A-4D-00
DNS server........................:
r6去telent r5时
<r6>telnet 22.0.0.1
Press CTRL_] to quit telnet mode
Trying 22.0.0.1 ...
Connected to 22.0.0.1 ...
Login authentication
Username:admin
Password:
<r1>
将R4到R5的1000M链路关掉,去测试浮动静态
[r4-GigabitEthernet0/0/2]shutdown
再去查看r4的路由表
[r4]display ip routing-table
0.0.0.0/0 Static 70 0 RD 192.168.1.22 GigabitEthernet
4/0/0
完成所有要求