问题描述:
一.进行合理的IP地址划分
二.配置IP地址
AR1:
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.17 28
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.33 28
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip add 192.168.1.129 29
[Huawei-LoopBack0]int l1
[Huawei-LoopBack1]ip add 192.168.1.137 29
AR2:
[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.18 28
[Huawei-GigabitEthernet0/0/0]
Sep 22 2021 21:16:29-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.49 28
Sep 22 2021 21:16:58-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip add 192.168.1.145 29
[Huawei-LoopBack0]int l1
[Huawei-LoopBack1]ip add 192.168.1.153 29
AR3:
[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.34 28
Sep 22 2021 21:24:50-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.65 28
[Huawei-GigabitEthernet0/0/1]
Sep 22 2021 21:25:06-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[Huawei-GigabitEthernet0/0/1]int g 0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 192.168.1.81 28
Sep 22 2021 21:25:23-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[2]:The line protocol
IP on the interface GigabitEthernet0/0/2 has entered the UP state.
AR4:
[Huawei]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 31 Routes : 32
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 D 192.168.1.98 GigabitEthernet
0/0/2
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Static 60 0 D 0.0.0.0 NULL0
192.168.1.16/28 Static 60 0 RD 192.168.1.49 GigabitEthernet
0/0/0
192.168.1.32/28 Static 60 0 RD 192.168.1.65 GigabitEthernet
0/0/1
192.168.1.48/28 Direct 0 0 D 192.168.1.50 GigabitEthernet
0/0/0
192.168.1.50/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.63/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.64/28 Direct 0 0 D 192.168.1.66 GigabitEthernet
0/0/1
192.168.1.66/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.79/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.80/28 Static 60 0 RD 192.168.1.65 GigabitEthernet
0/0/1
192.168.1.96/28 Direct 0 0 D 192.168.1.97 GigabitEthernet
0/0/2
192.168.1.97/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.111/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.112/28 Direct 0 0 D 192.168.1.113 GigabitEthernet
6/0/0
192.168.1.113/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
6/0/0
192.168.1.127/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
6/0/0
192.168.1.128/28 Static 60 0 RD 192.168.1.49 GigabitEthernet
0/0/0
Static 60 0 RD 192.168.1.65 GigabitEthernet
0/0/1
192.168.1.144/28 Static 60 0 RD 192.168.1.49 GigabitEthernet
0/0/0
192.168.1.160/28 Static 60 0 D 0.0.0.0 NULL0
192.168.1.160/29 Direct 0 0 D 192.168.1.161 LoopBack0
192.168.1.161/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.167/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.168/29 Direct 0 0 D 192.168.1.169 LoopBack1
192.168.1.169/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.175/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.176/28 Static 60 0 RD 192.168.1.98 GigabitEthernet
0/0/2
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
AR5:
[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.98 28
Sep 22 2021 21:29:40-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int g 0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 192.168.1.114 28
Sep 22 2021 21:30:03-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
IP on the interface GigabitEthernet0/0/1 has entered the UP state.
[Huawei-GigabitEthernet0/0/1]int l0
[Huawei-LoopBack0]ip add 192.168.1.177 28
[Huawei-LoopBack0]int g 0/0/2
[Huawei-GigabitEthernet0/0/2]ip add 12.0.0.1 24
Sep 22 2021 21:31:02-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[2]:The line protocol
IP on the interface GigabitEthernet0/0/2 has entered the UP state.
AR6:
[Huawei]int g 0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 12.0.0.2 24
[Huawei-GigabitEthernet0/0/0]
Sep 22 2021 21:31:33-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
IP on the interface GigabitEthernet0/0/0 has entered the UP state.
[Huawei-GigabitEthernet0/0/0]int l0
[Huawei-LoopBack0]ip add 1.1.1.1 24
三.配置AR3的dhcp
[Huawei]ip pool a
Info: It's successful to create an IP address pool.
[Huawei-ip-pool-a]net
[Huawei-ip-pool-a]netbios-type
[Huawei-ip-pool-a]network 192.168.1.81 m
[Huawei-ip-pool-a]network 192.168.1.81 mask 28
[Huawei-ip-pool-a]m
[Huawei-ip-pool-a]mtrace
[Huawei-ip-pool-a]mtrace a
[Huawei-ip-pool-a]g
[Huawei-ip-pool-a]gateway-list 192.168.1.81
[Huawei-ip-pool-a]dn
[Huawei-ip-pool-a]dns-list 8.8.8.8
[Huawei-ip-pool-a]q
[Huawei]dhcp en
[Huawei]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[Huawei]int g 0/0/2
[Huawei-GigabitEthernet0/0/2]d
[Huawei-GigabitEthernet0/0/2]ddns
[Huawei-GigabitEthernet0/0/2]description
[Huawei-GigabitEthernet0/0/2]dhcp se
[Huawei-GigabitEthernet0/0/2]dhcp select g
[Huawei-GigabitEthernet0/0/2]dhcp select global
四.配置缺省路由以及静态路由(顺便做浮动静态)
AR1:
[Huawei]ip route-static 0.0.0.0 0 192.168.1.18
[Huawei]ip route-static 0.0.0.0 0 192.168.1.34
[Huawei]ip route-static 192.168.1.144 28 192.168.1.18
[Huawei]ip route-static 192.168.1.48 28 192.168.1.18
[Huawei]ip route-static 192.168.1.64 28 192.168.1.34
[Huawei]ip route-static 192.168.1.80 28 192.168.1.34
AR2:
[Huawei]ip route-static 0.0.0.0 0 192.168.1.50
[Huawei]ip route-static 192.168.1.64 28 192.168.1.50
[Huawei]ip route-static 192.168.1.32 28 192.168.1.17
[Huawei]ip route-static 192.168.1.80 28 192.168.1.17
[Huawei]ip route-static 192.168.1.80 28 192.168.1.50
[Huawei]ip route-static 192.168.1.128 28 192.168.1.17
AR3:
[Huawei]ip route-static 0.0.0.0 0 192.168.1.66
[Huawei]ip route-static 192.168.1.144 28 192.168.1.66
[Huawei]ip route-static 192.168.1.144 28 192.168.1.33
[Huawei]ip route-static 192.168.1.16 28 192.168.1.33
[Huawei]ip route-static 192.168.1.48 28 192.168.1.66
[Huawei]ip route-static 192.168.1.128 28 192.168.1.33
AR4:
[Huawei]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 31 Routes : 32
Destination/Mask Proto Pre Cost Flags NextHop Interface
0.0.0.0/0 Static 60 0 D 192.168.1.98 GigabitEthernet
0/0/2
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/24 Static 60 0 D 0.0.0.0 NULL0
192.168.1.16/28 Static 60 0 RD 192.168.1.49 GigabitEthernet
0/0/0
192.168.1.32/28 Static 60 0 RD 192.168.1.65 GigabitEthernet
0/0/1
192.168.1.48/28 Direct 0 0 D 192.168.1.50 GigabitEthernet
0/0/0
192.168.1.50/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.63/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.64/28 Direct 0 0 D 192.168.1.66 GigabitEthernet
0/0/1
192.168.1.66/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.79/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.80/28 Static 60 0 RD 192.168.1.65 GigabitEthernet
0/0/1
192.168.1.96/28 Direct 0 0 D 192.168.1.97 GigabitEthernet
0/0/2
192.168.1.97/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.111/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.112/28 Direct 0 0 D 192.168.1.113 GigabitEthernet
6/0/0
192.168.1.113/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
6/0/0
192.168.1.127/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
6/0/0
192.168.1.128/28 Static 60 0 RD 192.168.1.49 GigabitEthernet
0/0/0
Static 60 0 RD 192.168.1.65 GigabitEthernet
0/0/1
192.168.1.144/28 Static 60 0 RD 192.168.1.49 GigabitEthernet
0/0/0
192.168.1.160/28 Static 60 0 D 0.0.0.0 NULL0
192.168.1.160/29 Direct 0 0 D 192.168.1.161 LoopBack0
192.168.1.161/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.167/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.168/29 Direct 0 0 D 192.168.1.169 LoopBack1
192.168.1.169/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.175/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.176/28 Static 60 0 RD 192.168.1.98 GigabitEthernet
0/0/2
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
AR5:
[Huawei]ip route-static 0.0.0.0 0 12.0.0.2
[Huawei]ip route-static 192.168.1.0 24 192.168.1.97
[Huawei]ip route-static 192.168.1.0 24 192.168.1.113 preference 70 //更改优先级
五.避免环路/处理黑洞
AR1:
[Huawei]ip route-static 192.168.1.128 28 NULL 0
AR2:
[Huawei]IP route-static 192.168.1.144 28 NULL 0
AR4:
[Huawei]IP route-static 192.168.1.160 28 NULL 0
[Huawei]IP route-static 192.168.1.0 24 NULL 0
六.远程登陆
AR1:
[Huawei]aaa
[Huawei-aaa]local-user admin privilege level 15 password cipher 123
[Huawei-aaa]local-user admin service-type telnet
[Huawei]user-interface vty 0 4
[Huawei-ui-vty0-4]authentication-mode aaa
[Huawei]sys 1
[1]
AR5:
[Huawei]acl 2000
[Huawei-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[Huawei-acl-basic-2000]q
[Huawei]int g 0/0/2
[Huawei-GigabitEthernet0/0/2]nat outbound 2000
[Huawei]sys 5
[5]int g 0/0/2
[5-GigabitEthernet0/0/2]nat server protocol tcp global current-interface 23 insi
de 192.168.1.17 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
[5-GigabitEthernet0/0/2]q
[5]
AR6:
<6>telnet 12.0.0.1
Press CTRL_] to quit telnet mode
Trying 12.0.0.1 ...
Connected to 12.0.0.1 ...
Login authentication
Username:admin
Password:
-----------------------------------------------------------------------------
User last login information:
-----------------------------------------------------------------------------
Access Type: Telnet
IP-Address : 192.168.1.18
Time : 2021-09-23 00:01:05-08:00
-----------------------------------------------------------------------------
<1>
备注:AR4上面的代码太长,被覆盖了看不了,请根据路由表进行相关解读与操作(后期有时间再做一遍补上)