task
- Except that the loopback address of R5 is fixed, all other network segments are reasonably divided into IP addresses based on 192.168.1.0/24
- R1-R4 each router has two loopback interfaces
- The static route to 5.5.5.0/24 cannot be written directly on R1-R4, but it can still be accessed
- The whole network can be reached, and the entries in the routing table of each router shall be minimized; Avoid looping
- Between R4 and R5, the normal 1000M connection communication is changed to 100M automatically in case of fault
analysis
0x01
All network segments (except R5) are reasonably divided into ip addresses based on 192.168.1.0/24
R1 - R4 each has two loopback addresses based on 192.168.1.0/24
We know that different ports between routers should belong to different network segments, so this topology requires a total of 14 network segments (including 5.5.5.0 / 24)
We need to divide the network segment 192.168.1.0/24
Network segment division (analysis)
In general, five different network segments are required. We divide 192.168.1.0/24 into 8 copies (borrow 3 bits from the host bit), which are:
192.167.1.0/27 192.168.1.32/27 192.168.1.64/27 192.168.1.96/27 192.168.1.128/27 --------------------((not required below) 192.168.1.160/27 192.168.1.192/27 192.168.1.224/27
A total of six network segments are required for backbone links. Similarly, we divide the 192.168.1.0/27 network segment into eight equally (borrow 3 bits from the host bit), which are:
192.168.1.0/30 192.168.1.4/30 192.168.1.8/30 192.168.1.12/30 192.168.1.16/30 192.168.1.20/30 --------------------((not required below) 192.168.1.24/30 192.168.1.28/30
In this way, there are exactly two IP addresses for each network segment, which is suitable for routing ports
In the loopback network segment, we only need to divide the first partition equally (borrow 1 bit from the host bit), which are:
R1:
192.168.1.32/28 192.168.1.48/28
R2:
192.168.1.64/28 192.168.1.80/28
R3:
192.168.1.96/28 192.168.1.112/28
R4:
192.168.1.128/28 192.168.1.144/28
0x02
The loopback route of 5.5.5.0/24 is 5.5.5.5/24
You can't write a static route directly to R1-R4. You can use the default route
0x03
Avoid loop and write anti loop routing
0x04
The last one means writing static floating routes
summary
Backbone link:
192.168.1.0/30 192.168.1.4/30 192.168.1.8/30 192.168.1.12/30 192.168.1.16/30 192.168.1.20/30
Loopback segment:
192.168.1.32/28 192.168.1.48/28 ---------------------- 192.168.1.64/28 192.168.1.80/28 ---------------------- 192.168.1.96/28 192.168.1.112/28 ---------------------- 192.168.1.128/28 192.168.1.144/28
to configure
IP
Configure direct IP
<Huawei>system-view [Huawei]sysname R1 [R1]interface g0/0/0 [R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30 [R1-GigabitEthernet0/0/0] Jan 7 2022 13:16:51-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]quit [R1-GigabitEthernet0/0/1]ip address 192.168.1.9 30 [R1-GigabitEthernet0/0/1] Jan 7 2022 13:17:23-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state.
test
Configure loopback segment IP
[R1]interface LoopBack 0 [R1-LoopBack0]ip address 192.168.1.33 28 [R1-LoopBack0]q [R1]interface LoopBack 1 [R1-LoopBack1]ip address 192.168.1.49 28
(take R1 as an example above)
Static routing
[R1]ip route-static 192.168.1.4 30 192.168.1.2 [R1]ip route-static 192.168.1.12 30 192.168.1.10 [R1]ip route-static 192.168.1.16 30 192.168.1.2 [R1]ip route-static 192.168.1.20 30 192.168.1.10 [R1]ip route-static 192.168.1.64 27 192.168.1.2 [R1]ip route-static 192.168.1.96 27 192.168.1.10 [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.10
(take R1 as an example)
test
Default route
[R1]ip route-static 0.0.0.0 0 192.168.1.2 [R2]ip route-static 0.0.0.0 0 192.168.1.6 [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 [R4]ip route-static 0.0.0.0 0 192.168.1.22
test
Anti loop routing
[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
Floating static routing
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 80 [R5]ip route-static 0.0.0.0 0 192.168.1.21 preference 80
Test:
We turn off Port 192.168.1.18/30 and test the connectivity
[R5]interface g0/0/0 [R5-GigabitEthernet0/0/0]shutdown Jan 7 2022 16:20:35-08:00 R5 %%01IFPDT/4/IF_STATE(l)[0]:Interface GigabitEthernet0/0/0 has turned into DOWN state. [R5-GigabitEthernet0/0/0] Jan 7 2022 16:20:36-08:00 R5 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the DOWN state. [R5-GigabitEthernet0/0/0]