第一步:划分子网
一共需要14个网段,包括6个骨干链路和8个环回接口。
在192.168.1.0/24上进行子网划分,划分如下:
192.168.1.0/24
192.168.1.000.00000/27 ----骨干链路
192.168.1.000 000 00/30 --- 192.168.1.0/30
192.168.1.000 001 00/30 --- 192.168.1.4/30
192.168.1.000 010 00/30 --- 192.168.1.8/30
192.168.1.000 011 00/30 --- 192.168.1.12/30
192.168.1.000 100 00/30 --- 192.168.1.16/30
192.168.1.000 101 00/30 --- 192.168.1.20/30
192.168.1.000 110 00/30
192.168.1.000 111 00/30
192.168.1.001 00000/27 --- r1
192.168.1.001 0 0000/28
192.168.1.001 1 0000/28
192.168.1.32/27 ---r1环回接口
192.168.1.32/28
192.168.1.48/28
192.168.1.010 00000/27 ---r2
192.168.1.010 0 0000/28
192.168.1.010 1 0000/28
192.168.1.64/27 ---r2环回接口
192.168.1.64/28
192.168.1.80/28
192.168.1.011 00000/27 --- r3
192.168.1.011 0 0000/28
192.168.1.011 1 0000/28
192.168.1.96/27 ---r3环回接口
192.168.1.96/28
192.168.1.112/28
192.168.1.100 00000/27 --- r4
192.168.1.100 0 0000/28
192.168.1.100 0 0000/28
192.168.1.128/27 ---r4环回接口
192.168.1.128/28
192.168.1.144/28
第二步:配IP
AR1:
<Huawei>SYS
Enter system view, return user view with Ctrl+Z.
[Huawei]SYS R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
Sep 11 2021 17:34:24-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R1-GigabitEthernet0/0/0]
[R1-GigabitEthernet0/0/0]int g 0/0/1
[R1-GigabitEthernet0/0/1]ip add 192.168.1.5
^
Error:Incomplete command found at '^' position.
[R1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
Sep 11 2021 17:35:10-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R1-GigabitEthernet0/0/1]q
[R1]int
[R1]interface l
[R1]interface LoopBack 1
[R1-LoopBack1]ip add 192.168.1.33 28
[R1-LoopBack1]int l1
[R1-LoopBack1]int
[R1-LoopBack1]int
[R1-LoopBack1]int l2
[R1-LoopBack2]ip add 192.168.1.49 28
[R1-LoopBack2]q
[R1]dis
[R1]display ip int
[R1]display ip interface bri
[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
LoopBack1 192.168.1.33/28 up up(s)
LoopBack2 192.168.1.49/28 up up(s)
NULL0 unassigned up up(s)
[R1]
AR2:
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r2
[r2]sys R2
[R2]int g 0/0/0
[R2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
Sep 11 2021 17:40:00-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R2-GigabitEthernet0/0/0]int g 0/0/1
[R2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
Sep 11 2021 17:40:31-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R2-GigabitEthernet0/0/1]int l
[R2-GigabitEthernet0/0/1]int l0
[R2-LoopBack0]ip add 192.168.1.65 28
[R2-LoopBack0]ip add 192.168.1.81 28
[R2-LoopBack0]undo ip add 192.168.1.81 28
[R2-LoopBack0]int l 1
[R2-LoopBack1]ip add 192.168.1.81 28
[R2-LoopBack0]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.2/30 up up
GigabitEthernet0/0/1 192.168.1.9/30 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.65/28 up up(s)
LoopBack1 192.168.1.81/28 up up(s)
NULL0 unassigned up up(s)
[R2-LoopBack0]
AR3
[Huawei]sys r3
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
Sep 11 2021 22:01:13-08:00 r3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r3-GigabitEthernet0/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
Sep 11 2021 22:01:31-08:00 r3 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r3-GigabitEthernet0/0/1]int l 1
[r3-LoopBack1]ip add 192.168 1.97 28
^
Error: Wrong parameter found at '^' position.
[r3-LoopBack1]ip add 192.168.1.97 28
[r3-LoopBack1]int l 2
[r3-LoopBack2]ip add 192.168.1.113 28
[r3-LoopBack2]disp
[r3-LoopBack2]display ip int
[r3-LoopBack2]display ip interface bri
[r3-LoopBack2]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.6/30 up up
GigabitEthernet0/0/1 192.168.1.13/30 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack1 192.168.1.97/28 up up(s)
LoopBack2 192.168.1.113/28 up up(s)
NULL0 unassigned up up(s)
[r3-LoopBack2]
AR4
<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r4
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.14 30
Sep 11 2021 22:03:26-08:00 r4 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.10 30
Sep 11 2021 22:03:48-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r4-GigabitEthernet0/0/1]int g0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.1.17 30
[r4-GigabitEthernet0/0/2]
Sep 11 2021 22:04:06-08:00 r4 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[r4-GigabitEthernet0/0/2]int g 4/0/0
[r4-GigabitEthernet4/0/0]ip add 192.168.1.21 30
Sep 11 2021 22:04:30-08:00 r4 %%01IFNET/4/LINK_STATE(l)[3]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the UP state.
[r4-GigabitEthernet4/0/0]int l 1
[r4-LoopBack1]ip add 192.168.1.129 28
[r4-LoopBack1]int l 2
[r4-LoopBack2]ip add 192.168.1.145 28
[r4-LoopBack2]disp
[r4-LoopBack2]display ip int
[r4-LoopBack2]display ip interface bri
[r4-LoopBack2]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 7
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 7
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.14/30 up up
GigabitEthernet0/0/1 192.168.1.10/30 up up
GigabitEthernet0/0/2 192.168.1.17/30 up up
GigabitEthernet4/0/0 192.168.1.21/30 up up
LoopBack1 192.168.1.129/28 up up(s)
LoopBack2 192.168.1.145/28 up up(s)
NULL0 unassigned up up(s)
[r4-LoopBack2]
AR5
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r5
[r5]int g o/o/o
^
Error: Wrong parameter found at '^' position.
[r5]ip add 192.168.1.18 30
^
Error: Unrecognized command found at '^' position.
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.18 30
[r5-GigabitEthernet0/0/0]
Sep 11 2021 22:07:27-08:00 r5 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[r5-GigabitEthernet0/0/0]int g 0/0/1
[r5-GigabitEthernet0/0/1]ip add 192.168.1.22 30
Sep 11 2021 22:07:43-08:00 r5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[r5-GigabitEthernet0/0/1]int l 1
[r5-LoopBack1]ip add 5.5.5.5 24
[r5-LoopBack1]dispp
[r5-LoopBack1]disp
[r5-LoopBack1]display ip int
[r5-LoopBack1]display ip interface bri
[r5-LoopBack1]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.18/30 up up
GigabitEthernet0/0/1 192.168.1.22/30 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack1 5.5.5.5/24 up up(s)
NULL0 unassigned up up(s)
[r5-LoopBack1]
第三步:写静态路由(环回)
AR1
[r1]ip route-sta
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.2
[r1]ip route-static 192.168.1.128 27 192.168.1.6
[r1]ip route-static 192.168.1.16 27 192.168.1.6
Info: The destination address and mask of the configured static route mismatched
, and the static route 192.168.1.0/27 was generated.
[r1]ip route-static 192.168.1.16 30 192.168.1.6
[r1]ip route-static 192.168.1.16 30 192.168.1.2
[r1]ip route-static 192.168.1.12 30 192.168.1.6
[r1]ip route-static 192.168.1.96 27 192.168.1.6
AR2
[r2]ip rou
[r2]ip route-sta
[r2]ip route-static 192.168.1.128 27 192.168.1.10
[r2]ip route-static 192.168.1.16 30 192.168.1.10
[r2]ip route-static 192.168.1.12 30 192.168.1.10
[r2]ip route-static 192.168.1.96 27 192.168.1.10
[r2]ip route-static 192.168.1.96 27 192.168.1.1
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.32 27 192.168.1.1
[r2]
AR3
[r3]ip rou
[r3]ip route-sta
[r3]ip route-static 192.168.1.32 27 192.168.1.5
[r3]ip route-static 192.168.1.0 30 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.5
[r3]ip route-static 192.168.1.64 27 192.168.1.24
[r3]ip route-static 192.168.1.8 30 192.168.1.14
[r3]ip route-static 192.168.1.128 27 192.168.1.14
[r3]ip route-static 192.168.1.16 30 192.168.1.14
[r3]
AR4
[r4]ip route-static 192.168.1.96 27 192.168.1.13
[r4]ip route-static 192.168.1.4 30 192.168.1.13
[r4]ip route-static 192.168.1.32 27 192.168.1.13
[r4]ip route-static 192.168.1.32 27 192.168.1.9
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.64 27 192.168.1.9
[r4]
AR5
[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
[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]
第四步:写缺省
AR1
[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
AR2
[r2]ip route-static 0.0.0.0 0 192.168.1.10
AR3
[r3]ip route-static 0.0.0.0 0 192.168.1.14
AR4
[r4]ip route-static 0.0.0.0 0 192.168.1.18
第五步,避免环路(做空接口)
[r1]ip route-static 192.168.1.32 27 NULL 0
[r2]ip route-static 192.168.1.64 27 NULL 0
[r3]ip route-static 192.168.1.96 27 NULL 0
[r4]ip route-static 192.168.1.128 27 NULL 0
此时,AR1-AR4之间可以ping通。
[r1]undo ip route-static 192.168.1.20 30 192.168.1.0
[r1]display ip routing-table
[r2]ip route-static 192.168.1.20 30 192.168.1.10
[r3]ip route-static 192.168.1.20 30 192.168.1.14
[r4]ip route-static 0.0.0.0 0 192.168.1.22 pre
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
最后一步:设置浮动静态路由优先级(r5)
[r5]ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 preference 61
[r5]ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 preference 61
[r5]display this
[V200R003C00]
#
sysname r5
#
snmp-agent local-engineid 800007DB03000000000000
snmp-agent
#
clock timezone China-Standard-Time minus 08:00:00
#
portal local-server load portalpage.zip
#
drop illegal-mac alarm
#
set cpu-usage threshold 80 restore 75
#
ip route-static 192.168.1.0 255.255.255.252 192.168.1.17
ip route-static 192.168.1.0 255.255.255.252 192.168.1.21 preference 61
ip route-static 192.168.1.4 255.255.255.252 192.168.1.17
ip route-static 192.168.1.4 255.255.255.252 192.168.1.21 preference 61
ip route-static 192.168.1.8 255.255.255.252 192.168.1.17
ip route-static 192.168.1.8 255.255.255.252 192.168.1.21 preference 61
ip route-static 192.168.1.12 255.255.255.252 192.168.1.17
ip route-static 192.168.1.12 255.255.255.252 192.168.1.21 preference 61
ip route-static 192.168.1.32 255.255.255.224 192.168.1.17
ip route-static 192.168.1.32 255.255.255.224 192.168.1.21 preference 61
ip route-static 192.168.1.64 255.255.255.224 192.168.1.17
ip route-static 192.168.1.64 255.255.255.224 192.168.1.21 preference 61
ip route-static 192.168.1.96 255.255.255.224 192.168.1.17
ip route-static 192.168.1.96 255.255.255.224 192.168.1.21 preference 61
ip route-static 192.168.1.128 255.255.255.224 192.168.1.17
ip route-static 192.168.1.128 255.255.255.224 192.168.1.21 preference 61
#
关闭r4的4/0/0 接口
[r4]int g 4/0/0
[r4-GigabitEthernet4/0/0]shutdown
Sep 11 2021 23:43:14-08:00 r4 %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEthern
et4/0/0 has turned into DOWN state.
[r4-GigabitEthernet4/0/0]
[r4-GigabitEthernet4/0/0]
Sep 11 2021 23:43:14-08:00 r4 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet4/0/0 has entered the DOWN state.
[r4-GigabitEthernet4/0/0]
最后ping网通,关闭r4的4/0/0端口,用r1 ping r5
关闭r4的0/0/2端口,用r5 ping r1