目录
1.按题意拓扑设计并规划IP地址
按要求完成子网划分:
192.168.1.000 00000 192.168.1.0 27 骨干链路使用
再次划分192.168.1.000 000 00 30
192.168.1.0
192.168.1.4
192.168.1.8
192.168.1.16
…….
192.168.1.48
192.168.1.001 00000 192.168.1.32 27 R1上环回
再次划分 192.168.1.001 0 0000 28
192.168.1.32 28
192.168.1.48 28
192.168.1.010 00000 192.168.1.64 27 R2上环回
再次划分 192.168.1.010 0 0000 28
192.168.1.64 28
192.168.1.80 28
192.168.1.011 00000 192.168.1.96 27 R4 上使用
再次划分192.168.1.011 0 0000 28
192.168.1.96 28
192.168.1.113 28
192.168.1.100 00000 192.168.1.128 27
保留地址:
192.168.1.101 00000 192.168.1.160 27
192.168.1.110 00000 192.168.1.192 27
192.168.1.111 00000 192.168.1.224 27
拓扑设计如下:
2.搭建拓扑并进行基础IP配置 指令如下:
R1配置
<Huawei>system-view
[Huawei]sysname R1
网关配置
[R1]interface GigabitEthernet 0/0/0
[R1-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[R1-GigabitEthernet0/0/0]quit
[R1]interface GigabitEthernet 0/0/1
[R1-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[R1-GigabitEthernet0/0/1]q
回环接口配置
[R1]interface LoopBack 01
[R1-LoopBack1]ip address 192.168.1.33 28
[R1-LoopBack1]q
[R1]interface LoopBack 0
[R1-LoopBack0]ip address 192.168.1.49 28
R2配置
<Huawei>system-view
[Huawei]sysname R2
网关配置
[R2]interface GigabitEthernet 0/0/0
[R2-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[R2-GigabitEthernet0/0/0]q
[R2]interface GigabitEthernet 0/0/1
[R2-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[R2-GigabitEthernet0/0/1]q
回环接口配置
[R2]interface LoopBack 01
[R2-LoopBack1]ip address 192.168.1.97 28
[R2-LoopBack1]q
[R2]interface LoopBack 0
[R2-LoopBack0]ip address 192.168.1.114 28
R3配置
Huawei>system-view
[Huawei]sysname R3
网关配置
[R3]interface GigabitEthernet 0/0/0
[R3-GigabitEthernet0/0/0]ip address 192.168.1.10 30
[R3-GigabitEthernet0/0/0]q
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]ip address 192.168.1.129 27
[R3-GigabitEthernet0/0/2]q
[R3]interface GigabitEthernet 0/0/1
[R3-GigabitEthernet0/0/1]ip address 192.168.1.13 30
R4配置
<Huawei>system-view
[Huawei]sysname R4
网关配置
[R4]interface GigabitEthernet 0/0/0
[R4-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[R4-GigabitEthernet0/0/0]q
[R4]interface GigabitEthernet 0/0/1
[R4-GigabitEthernet0/0/1]ip address 192.168.1.14 30
[R4-GigabitEthernet0/0/1]q
[R4]interface GigabitEthernet 0/0/2
[R4-GigabitEthernet0/0/2]ip address 192.168.1.17 30
回环接口配置
[R4-GigabitEthernet0/0/2]q
[R4]interface LoopBack 01
[R4-LoopBack1]ip address 192.168.1.65 28
[R4-LoopBack1]q
[R4]interface LoopBack 0
[R4-LoopBack0]ip address 192.168.1.81 30
R5配置
<Huawei>system-view
[Huawei]sysname R5
网关配置
[R5]interface GigabitEthernet 0/0/0
[R5-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[R5-GigabitEthernet0/0/0]q
[R5]interface GigabitEthernet 0/0/1
[R5-GigabitEthernet0/0/1]ip address 192.168.1.22 30回环接口配置
[R5-GigabitEthernet0/0/1]q
[R5]interface LoopBack 01
[R5-LoopBack1]ip address 5.5.5.5 24
[R5-LoopBack1]q
[R5]interface LoopBack 0
[R5-LoopBack0]ip address 6.6.6.6 24
最后输入display ip interface brief 对配置指令进行检查
3.静态路由配置
R1配置
[R1]ip route-static 192.168.1.4 30 192.168.1.2
[R1]ip route-static 192.168.1.16 30 192.168.1.2
[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.2
[R1]ip route-static 192.168.1.128 27 192.168.1.10
[R1]ip route-static 192.168.1.64 27 192.168.1.10
[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.10
R2配置
[R2]ip route-static 192.168.1.32 27 192.168.1.1
[R2]ip route-static 192.168.1.128 27 192.168.1.1
[R2]ip route-static 192.168.1.64 27 192.168.1.6
[R2]ip route-static 192.168.1.128 27 192.168.1.6
[R2]ip route-static 192.168.1.12 30 192.168.1.6
[R2]ip route-static 192.168.1.16 30 192.168.1.6
[R2]ip route-static 192.168.1.8 30 192.168.1.1
R3配置
[R3]ip route-static 192.168.1.32 27 192.168.1.9
[R3]ip route-static 192.168.1.96 27 192.168.1.9
[R3]ip route-static 192.168.1.64 27 192.168.1.14
[R3]ip route-static 192.168.1.4 30 192.168.1.14
[R3]ip route-static 192.168.1.16 30 192.168.1.14
[R3]ip route-static 192.168.1.96 27 192.168.1.14
[R3]ip route-static 192.168.1.0 27 192.168.1.9
R4配置
[R4]ip route-static 192.168.1.96 27 192.168.1.5
[R4]ip route-static 192.168.1.32 27 192.168.1.5
[R4]ip route-static 192.168.1.0 30 192.168.1.5
[R4]ip route-static 192.168.1.8 30 192.168.1.13
[R4]ip route-static 192.168.1.128 27 192.168.1.13
[R4]ip route-static 192.168.1.32 27 192.168.1.13
R5配置
[R5]ip route-static 192.168.1.32 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.64 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.8 30 192.168.1.17
[R5]ip route-static 192.168.1.128 27 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.4 30 192.168.1.17
测试
用R1的一个网关去pingR5
<R1>PING -a 192.168.1.49 192.168.1.18
PING 192.168.1.18: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.18: bytes=56 Sequence=1 ttl=253 time=50 ms
Reply from 192.168.1.18: bytes=56 Sequence=2 ttl=253 time=40 ms
Reply from 192.168.1.18: bytes=56 Sequence=3 ttl=253 time=40 ms
Reply from 192.168.1.18: bytes=56 Sequence=4 ttl=253 time=40 ms
Reply from 192.168.1.18: bytes=56 Sequence=5 ttl=253 time=40 ms--- 192.168.1.18 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 40/42/50 ms
结果证明已经完成要求1和2网络状况良好
配置缺省路由,以达到要求3
配置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.10
配置R2
[R2]ip route-static 0.0.0.0 0 192.168.1.6
配置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
测试
[R1]ping -a 192.168.1.33 192.168.1.18
PING 192.168.1.18: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.18: bytes=56 Sequence=1 ttl=253 time=70 ms
Reply from 192.168.1.18: bytes=56 Sequence=2 ttl=253 time=30 ms
Reply from 192.168.1.18: bytes=56 Sequence=3 ttl=253 time=50 ms
Reply from 192.168.1.18: bytes=56 Sequence=4 ttl=253 time=40 ms
Reply from 192.168.1.18: bytes=56 Sequence=5 ttl=253 time=50 ms--- 192.168.1.18 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 30/48/70 ms结果满足要求3
解决环路问题
由于缺省和黑洞相遇必定成环,因此我们需要给缺省路由配置空接口
R1配置
[R1]ip route-static 192.168.1.32 27 NULL 0
R2配置
[R2]ip route-static 192.168.1.96 27 NULL 0
R4配置
[R4]ip route-static 192.168.1.64 27 NULL 0
最后输入display ip routing-table protocol static 对配置后的路由表进行检查
浮动静态路由,达成要求5
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.21 preference 70
[R5]ip route-static 192.168.1.64 27 192.168.1.21 preference 70
[R5]ip route-static 192.168.1.96 27 192.168.1.21 preference 70
[R5]ip route-static 192.168.1.128 27 192.168.1.21 preference 70
[R5]ip route-static 192.168.1.0 30 192.168.1.21 preference 70
[R5]ip route-static 192.168.1.4 30 192.168.1.21 preference 70
[R5]ip route-static 192.168.1.8 30 192.168.1.21 preference 70
[R5]ip route-static 192.168.1.12 30 192.168.1.21 preference 70
配置DHCP服务器
配置
操 作:对象R3
配置命令:
[R3]dhcp enable
[R3]ip pool aaa
[R3-ip-pool-aaa]network 192.168.1.128 mask 27
[R3-ip-pool-aaa]gateway-list 192.168.1.129
[R3-ip-pool-aaa]dns-list 8.8.8.8 114.114.114.114
[R3-ip-pool-aaa]q
[R3]interface GigabitEthernet 0/0/2
[R3-GigabitEthernet0/0/2]dhcp select global
检测
选择设备PC1输入一下命令进行检测
PC>ipconfig
Link local IPv6 address...........: fe80::5689:98ff:fef9:30b2
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 192.168.1.158
Subnet mask.......................: 255.255.255.224
Gateway...........................: 192.168.1.129
Physical address..................: 54-89-98-F9-30-B2
DNS server........................: 8.8.8.8
114.114.114.114
PC>ping 5.5.5.5Ping 5.5.5.5: 32 data bytes, Press Ctrl_C to break
From 5.5.5.5: bytes=32 seq=1 ttl=253 time=62 ms
From 5.5.5.5: bytes=32 seq=2 ttl=253 time=63 ms
From 5.5.5.5: bytes=32 seq=3 ttl=253 time=62 ms
From 5.5.5.5: bytes=32 seq=4 ttl=253 time=47 ms
From 5.5.5.5: bytes=32 seq=5 ttl=253 time=62 ms--- 5.5.5.5 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 47/59/63 ms
至此所有要求均满足实验成功