要求:
IP地址规划
根据分配的IP地址给R1配地址
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R1
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.33 28
[R1-LoopBack0]interface LoopBack 1
[R1-LoopBack1]ip address 192.168.1.49 28
[R1-LoopBack1]quit
[R1]
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
Jul 9 2023 14:20:20-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]int g0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.9 30
Jul 9 2023 14:20:44-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
R2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R2
[R2]int
[R2]interface lo
[R2]interface LoopBack 0
[R2-LoopBack0]ip ad
[R2-LoopBack0]ip address 192.168.1.97 28
[R2-LoopBack0]interface LoopBack 1
[R2-LoopBack1]ip address 192.168.1.113 28
[R2-LoopBack1]q
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
Jul 9 2023 14:23:50-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 g0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[R2-GigabitEthernet0/0/1]
Jul 9 2023 14:24: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]q
[R2]q
给R3上配置DHCP服务
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip ad
[R3-GigabitEthernet0/0/0]ip address 192.168.1.10 30
Jul 9 2023 14:36:29-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP
on the interface GigabitEthernet0/0/0 has entered the UP state.
[R3-GigabitEthernet0/0/0]int g0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.14 30
Jul 9 2023 14:36:48-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP
on the interface GigabitEthernet0/0/1 has entered the UP state.
[R3-GigabitEthernet0/0/1]int g0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.1.128 27
Error: The specified IP address is invalid.
[R3-GigabitEthernet0/0/2]ip address 192.168.1.129 27
[R3-GigabitEthernet0/0/2]
Jul 9 2023 14:37:46-08:00 R3 %%01IFNET/4/LINK_STATE(l)[2]:The line protocol IP
on the interface GigabitEthernet0/0/2 has entered the UP state.
[R3-GigabitEthernet0/0/2]q
[R3]dhcp e
[R3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[R3]ip po
[R3]ip policy-based-route
[R3]ip pool aa
Info: It's successful to create an IP address pool.
[R3-ip-pool-aa]net
[R3-ip-pool-aa]netbios-type
[R3-ip-pool-aa]network 192.168.1.128 ma
[R3-ip-pool-aa]network 192.168.1.128 mask 27
[R3-ip-pool-aa]ga
[R3-ip-pool-aa]gateway-list 192.168.1.129
[R3-ip-pool-aa]dns
[R3-ip-pool-aa]dns-list 8.8.8.8 114.114.114.114
[R3-ip-pool-aa]q
[R3]int g0/0/2
[R3-GigabitEthernet0/0/2]dh
[R3-GigabitEthernet0/0/2]dhcp se
[R3-GigabitEthernet0/0/2]dhcp select gl
[R3-GigabitEthernet0/0/2]dhcp select global
[R3-GigabitEthernet0/0/2]q
[R3]q
R4
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys R4
[R4]int g0/0/0
[R4-GigabitEthernet0/0/0]ip ad
[R4-GigabitEthernet0/0/0]ip address 192.168.1.13 30
Jul 9 2023 14:36:29-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 g0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.6 30
Jul 9 2023 14:36:48-08:00 R3 %%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 address 192.168.1.17 30
[R4-GigabitEthernet0/0/2]
Jul 9 2023 14:37:46-08:00 R3 %%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]q
[R4]int g4/0/0[R4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[R4]q
R5同上
R1-R4上不能直接编写到达5.5.5.5/24的静态路由,但依然可以访问
在R1 ,R2,R3,R4,上写一条缺省
[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.10
[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.13[R4]ip route-static 0.0.0.0 0 192.168.1.18
利用空接口来解决黑洞问题配置:
[R4]ip route-static 192.168.1.64 27 NULL 0
[R1]ip route-static 192.168.1.32 27 NULL 0
[R2]ip route-static 192.168.1.96 27 NULL 0
R4与R5间,正常1000M链路通讯,故障时自动改为100M
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
测试:
关闭接口前
关闭接口后