一、配置IP和环回接口
R1
[Huawei]int g0/0/0
[Huawei-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[Huawei]sys r1
[r1]int lo0
[r1-LoopBack0]ip address 192.168.1.33 28
[r1-LoopBack0]q
[r1]int lo1
[r1-LoopBack1]ip address 192.168.1.49 28
R2
[r2]int g0/0/0
[r2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r2]int g0/0/1
[r2-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[r2]int lo0
[r2-LoopBack0]ip address 192.18.1.65 28
[r2-LoopBack0]q
[r2]int lo1
[r2-LoopBack1]ip address 192.168.1.81 28
R3
[r3]int g0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[r3]int g0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]ip address 192.168.1.97 27
R4
[r4]int g0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[r4]int g0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[r4]int g0/0/2
[r4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[r4]int g4/0/0
[r4-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[r4]int lo0
[r4-LoopBack0]ip address 192.168.1.129 28
[r4-LoopBack0]q
[r4]int lo1
[r4-LoopBack1]ip address 192.168.1.145 28
R5
[r5]int g0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[r5]int g0/0/1
[r5-GigabitEthernet0/0/1]ip address 192.168.1.22 30
[r5]int g0/0/2
[r5-GigabitEthernet0/0/2]ip address 56.1.1.1 24
[r5]int lo0
[r5-LoopBack0]ip address 192.168.1.161 28
R6
[r6]int g0/0/0
[r6-GigabitEthernet0/0/0]ip address 56.1.1.2 24
[r6]int lo0
[r6-LoopBack0]ip address 6.6.6.6 24
二、DHCP配置
<r3>sys
Enter system view, return user view with Ctrl+Z.
[r3]dhcp enable
Info: The operation may take a few seconds. Please wait for a moment.done.
[r3]ip pool 1
Info: It's successful to create an IP address pool.
[r3-ip-pool-1]network 192.168.1.96 mask 27
[r3-ip-pool-1]gateway-list 192.168.1.97
[r3-ip-pool-1]dns-list 8.8.8.8
[r3-ip-pool-1]q
[r3]int g0/0/2
[r3-GigabitEthernet0/0/2]dhcp select global
查看PC1的IP
查看PC2的IP
三、配置缺省路由
R1
[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
R2
[r2]ip route-static 0.0.0.0 0 192.168.1.10
R3
[r3]ip route-static 0.0.0.0 0 192.168.1.14
R4
[r4]ip route-static 0.0.0.0 0 192.168.1.18
R5
[r5]ip route-static 0.0.0.0 0 56.1.1.2
填上静态路由
R1
[r1]ip route-static 192.168.1.64 27 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.96 27 192.168.1.6
[r1]ip route-static 192.168.1.12 30 192.168.1.6
R2
[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]ip route-static 192.168.1.96 27 192.168.1.1
R3
[r3]ip route-static 192.168.1.0 30 192.168.1.1
[r3]ip route-static 192.168.1.32 27 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.14
R4
[r4]ip route-static 192.168.1.64 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.32 27 192.168.1.9
[r4]ip route-static 192.168.1.32 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.96 27 192.168.1.13
配置R4备用线路
[r4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
R5
[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备用线路
[r5]ip route-static 192.168.1.32 27 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.64 27 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.96 27 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.128 27 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.0 30 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.4 30 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.8 30 192.168.1.21 pr 61
[r5]ip route-static 192.168.1.12 30 192.168.1.21 pr 61
在R5g0/0/2接口做个acl
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.225
[r5-acl-basic-2000]q
[r5]int g0/0/2
[r5-GigabitEthernet0/0/2]nat outbound 2000
避免环路 配置空接口
R1
[r1]ip route-static 192.168.1.32 27 NULL 0
R2
[r2]ip route-static 192.168.1.64 27 NULL 0
R4
[r4]ip route-static 192.168.1.128 27 NULL 0
打开R1的telnet服务
[r1]aaa
[r1-aaa]local-user haha privilege level 15 password cipher 123123
Info: Add a new user.
定义账号作用
[r1-aaa]local-user haha service-type telnet
[r1-aaa]q
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
映射
在R5g0/0/2接口
[r5-GigabitEthernet0/0/2]nat server protocol tcp global current-interface 23 ins
ide 192.168.1.1 23