题目及要求
第一步:拓扑的搭建
第二步:路由、IP的配置
r1:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r1
[r1]int loop
[r1]int LoopBack 0
[r1-LoopBack0]ip add 192.168.1.65 27
[r1-LoopBack0]int loop 1
[r1-LoopBack1]ip add 192.168.1.97 27
[r1-LoopBack1]int g 0/0/0
[r1-GigabitEthernet0/0/0]ip add 192.168.1.1 30
[r1-GigabitEthernet0/0/0]int g 0/0/1
[r1-GigabitEthernet0/0/1]ip add 192.168.1.5 30
[r1-GigabitEthernet0/0/1]
[r1-GigabitEthernet0/0/1]
[r1]ip route-static 192.168.1.128 26 192.168.1.2
[r1]ip route-static 192.168.1.8 30 192.168.1.2
[r1]ip route-static 192.168.1.20 30 192.168.1.2
[r1]ip route-static 192.168.1.24 30 192.168.1.2
[r1]ip route-static 192.168.1.48 29 192.168.1.2
[r1]ip route-static 192.168.1.32 28 192.168.1.2
[r1]ip route-static 192.168.1.32 28 192.168.1.6
[r1]ip route-static 192.168.1.48 29 192.168.1.6
[r1]ip route-static 192.168.1.24 30 192.168.1.6
[r1]ip route-static 192.168.1.20 30 192.168.1.6
[r1]ip route-static 192.168.1.12 30 192.168.1.6
[r1]ip route-static 192.168.1.192 26 192.168.1.6
[r1]ip route- 0.0.0.0 0 192.168.1.2
[r1]ip route- 0.0.0.0 0 192.168.1.6
[r1]
[r1]ip route-static 192.168.1.64 26 null 0
[r1]aaa
[r1-aaa]local-user qinpu privilege level 15 password cipher 12345
Info: Add a new user.
[r1-aaa]local-user qinpu service-type telnet
[r1-aaa]q
[r1]user-interface vty 0 4
[r1-ui-vty0-4]authentication-mode aaa
[r1-ui-vty0-4]
r2:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r2
[r2]int g 0/0/0
[r2-GigabitEthernet0/0/0]ip add 192.168.1.2 30
[r2-GigabitEthernet0/0/0]int g 0/0/1
[r2-GigabitEthernet0/0/1]ip add 192.168.1.9 30
[r2-GigabitEthernet0/0/1]int lo0
[r2-LoopBack0]ip add 192.168.1.129 27
[r2-LoopBack0]int lo1
[r2-LoopBack1]ip add 192.168.1.161 27
[r2-LoopBack1]
[r2]ip route-static 192.168.1.64 26 192.168.1.1
[r2]ip route-static 192.168.1.4 30 192.168.1.1
[r2]ip route-static 192.168.1.192 26 192.168.1.1
[r2]ip route-static 192.168.1.192 26 192.168.1.10
[r2]ip route-static 192.168.1.12 30 192.168.1.10
[r2]ip route-static 192.168.1.32 28 192.168.1.10
[r2]ip route-static 192.168.1.20 30 192.168.1.10
[r2]ip route-static 192.168.1.24 30 192.168.1.10
[r2]ip route-static 192.168.1.48 29 192.168.1.10
[r2]ip route-static 0.0.0.0 0 192.168.1.10
[r2]ip route-static 192.168.1.128 26 null 0
[r2]
r4:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r4
[r4]int lo0
[r4-LoopBack0]ip add 192.168.1.33 29
[r4-LoopBack0]int lo1
[r4-LoopBack1]ip add 192.168.1.41 29
[r4-LoopBack1]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip add 192.168.1.14 30
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip add 192.168.1.10 30
[r4-GigabitEthernet0/0/1]
[r4-GigabitEthernet0/0/1]int g 0/0/2
[r4-GigabitEthernet0/0/2]ip add 192.168.1.21 30
[r4-GigabitEthernet0/0/2]
[r4-GigabitEthernet0/0/2]int e 4/0/0
[r4-Ethernet4/0/0]ip add 192.168.1.25 30
[r4-Ethernet4/0/0]
[r4-Ethernet4/0/0]
[r4]ip route-static 192.168.1.64 26 192.168.1.9
[r4]ip route-static 192.168.1.64 26 192.168.1.13
[r4]ip route-static 192.168.1.4 30 192.168.1.13
[r4]ip route-static 192.168.1.0 30 192.168.1.9
[r4]ip route-static 192.168.1.128 26 192.168.1.9
[r4]ip route-static 192.168.1.192 26 192.168.1.13
[r4]ip route-static 192.168.1.48 29 192.168.1.22
[r4]ip route-static 192.168.1.48 29 192.168.1.26 preference 61
[r4]ip route-static 0.0.0.0 0 192.168.1.22
[r4]ip route-static 0.0.0.0 0 192.168.1.26 preference 61
[r4]ip route-static 192.168.1.32 28 null 0
[r4]
r5:
[Huawei]sys r5
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip add 192.168.1.22 30
[r5]int g 0/0/1
[r5-GigabitEthernet0/0/1]ip add 5.5.5.5 30
[r5-GigabitEthernet0/0/1]int lo0
[r5-LoopBack0]ip add 192.168.1.49 29
[r5]ip route-static 192.168.1.64 26 192.168.1.21
[r5]ip route-static 192.168.1.0 30 192.168.1.21
[r5]ip route-static 192.168.1.8 30 192.168.1.21
[r5]ip route-static 192.168.1.128 26 192.168.1.21
[r5]ip route-static 192.168.1.192 26 192.168.1.21
[r5]ip route-static 192.168.1.12 30 192.168.1.21
[r5]ip route-static 192.168.1.4 30 192.168.1.21
[r5]ip route-static 192.168.1.32 28 192.168.1.21
[r5]ip route-static 192.168.1.64 26 192.168.1.25 pr 61
[r5]ip route-static 192.168.1.0 30 192.168.1.25 pr 61
[r5]ip route-static 192.168.1.8 30 192.168.1.25 pr 61
[r5]ip route-static 192.168.1.128 26 192.168.1.25 pr 61
[r5]ip route-static 192.168.1.192 26 192.168.1.25 pr 61
[r5]ip route-static 192.168.1.12 30 192.168.1.25 pr 61
[r5]ip route-static 192.168.1.4 30 192.168.1.25 pr 61
[r5]ip route-static 192.168.1.32 28 192.168.1.25 pr 61
[r5]ip route-static 0.0.0.0 0 5.5.5.6
[r5]acl 2000
[r5-acl-basic-2000]rule permit source 192.168.1.0 0.0.0.255
[r5-acl-basic-2000]q
[r5]int g 0/0/1
[r5-GigabitEthernet0/0/1]nat outbound 2000
[r5-GigabitEthernet0/0/1]
r6:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys r6
[r6]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip add 5.5.5.6 30
[r6-GigabitEthernet0/0/0]int loop 0
[r6-LoopBack0]ip add 6.6.6.6 24
[r6-LoopBack0]
[r5]int g 0/0/1
[r5-GigabitEthernet0/0/1]nat static protocol tcp global current-interface 23 inside 192.168.1.1 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
[r5-GigabitEthernet0/0/1]
r3:
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname r3
[r3]int g 0/0/0
[r3-GigabitEthernet0/0/0]ip add 192.168.1.6 30
[r3-GigabitEthernet0/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip add 192.168.1.13 30
[r3]int g 0/0/2.1
[r3-GigabitEthernet0/0/2.1]ip add 192.168.1.193 27
[r3-GigabitEthernet0/0/2.1]int g 0/0/2.2
[r3-GigabitEthernet0/0/2.2]ip add 192.168.1.226 27
[r3-GigabitEthernet0/0/2.2]q
[r3]dhcp enable
[r3]ip pool xiaopu
Info: It's successful to create an IP address pool.
[r3-ip-pool-xiaopu]network 192.168.1.192 mask 27
[r3-ip-pool-xiaopu]gateway-list 192.168.1.193
[r3-ip-pool-xiaopu]q
[r3]ip pool xiaopu
Info: It's successful to create an IP address pool.
[r3-ip-pool-xiaopu]network 192.168.1.225 mask 27
[r3-ip-pool-xiaopu]gateway-list 192.168.1.226
[r3-GigabitEthernet0/0/2.2]dhcp select global
[r3-GigabitEthernet0/0/2.2]int g 0/0/2.1
[r3-GigabitEthernet0/0/2.1]dhcp select global
[r3-GigabitEthernet0/0/2.1]
[r3]int g 0/0/2.1
[r3-GigabitEthernet0/0/2.1]dot1q termination vid 2
[r3-GigabitEthernet0/0/2.1]arp broadcast enable
[r3-GigabitEthernet0/0/2.1]int g 0/0/2.2
[r3-GigabitEthernet0/0/2.2]dot1q termination vid 3
[r3-GigabitEthernet0/0/2.2]arp broadcast enable
[r3-GigabitEthernet0/0/2.2]
[r3]ip route-static 192.168.1.64 26 192.168.1.5
[r3]ip route-static 192.168.1.0 30 192.168.1.5
[r3]ip route-static 192.168.1.128 26 192.168.1.5
[r3]ip route-static 192.168.1.128 26 192.168.1.14
[r3]ip route-static 192.168.1.8 30 192.168.1.14
[r3]ip route-static 192.168.1.20 30 192.168.1.14
[r3]ip route-static 192.168.1.24 30 192.168.1.14
[r3]ip route-static 192.168.1.48 29 192.168.1.14
[r3]ip route-static 192.168.1.32 28 192.168.1.14
[r3]ip route-static 0.0.0.0 0 192.168.1.14
[r3]ip route-static 192.168.1.192 26 null 0
[r3]
效果部分展示:
注意;这里的pc1和pc2需要改为DHCP