
一共5个路由器,6个网段共用192.168.1.0/24,6个网段
首先配置R3,R4,R5,R6路由器,主干网络只有对端两个地址则可将子网设置为30,路由器配置192.168.1.000000 00/30,防止IP浪费
192.168.1.000000 00/30 192.168.1.0/30
192.168.1.000001 00/30 192.168.1.4/30
192.168.1.000010 00/30 192.168.1.8/30
192.168.1.000011 00/30 192.168.1.12/30
192.168.1.000100 00/30 192.168.1.16/30
192.168.1.000101 00/30 192.168.1.20/30
192.168.1.000110 00/30 192.168.1.24/30
192.168.1.000111 00/30 192.168.1.28/30
环回地址
192.168.1.001 00000/27 192.168.1.32/27---R3
----------------------192.168.1.32/28
----------------------192.168.1.48/28
192.168.1.010 00000/27 192.168.1.64/27---R4
----------------------192.168.1.64/28
----------------------192.168.1.80/28
192.168.1.011 00000/27 192.168.1.96/27---R5
----------------------192.168.1.96/28
----------------------192.168.1.112/28
192.168.1.100 00000/27 192.168.1.128/27--R6
----------------------192.168.1.128/28
----------------------192.168.1.144/28
192.168.1.101 00000/27 192.168.1.160/27--R7
----------------------192.168.1.160/28
----------------------192.168.1.176/28
192.168.1.110 00000/27 192.168.1.192/27
192.168.1.111 00000/27 192.168.1.224/27
两条备用
[r3]interface GigabitEthernet 0/0/0
[r3-GigabitEthernet0/0/0]ip address 192.168.1.1 30
[r3-GigabitEthernet0/0/0]int g 0/0/1
[r3-GigabitEthernet0/0/1]ip address 192.168.1.5 30
[r3-GigabitEthernet0/0/1]q
[r3]interface LoopBack 0
[r3-LoopBack0]ip address 192.168.1.33 28
[r3-LoopBack0]int loopback 1
[r3-LoopBack1]ip address 192.168.1.49 28
[r4]int g 0/0/0
[r4-GigabitEthernet0/0/0]ip address 192.168.1.2 30
[r4-GigabitEthernet0/0/0]
[r4-GigabitEthernet0/0/0]int g 0/0/1
[r4-GigabitEthernet0/0/1]ip address 192.168.1.9 30
[r4-GigabitEthernet0/0/1]q
[r4]int loopback 0
[r4-LoopBack0]ip address 192.168.1.65 28
[r4-LoopBack0]int loopback 1
[r4-LoopBack1]ip address 192.168.1.81 28
[r5]int g 0/0/0
[r5-GigabitEthernet0/0/0]ip address 192.168.1.6 30
[r5-GigabitEthernet0/0/0]int g 0/0/1
[r5-GigabitEthernet0/0/1]ip address 192.168.1.13 30
[r5-GigabitEthernet0/0/1]q
[r5]int loopback 0
[r5-LoopBack0]ip address 192.168.1.97 28
[r5-LoopBack0]int l 1
[r5-LoopBack1]ip address 192.168.1.113 28
[r6]int g 0/0/1
[r6-GigabitEthernet0/0/1]ip address 192.168.1.10 30
[r6-GigabitEthernet0/0/1]int g 0/0/0
[r6-GigabitEthernet0/0/0]ip address 192.168.1.14 30
[r6-GigabitEthernet0/0/0]q
[r6]int loopback 0
[r6-LoopBack0]ip address 192.168.1.129 28
[r6-LoopBack0]int l 1
[r6-LoopBack1]ip address 192.168.1.145 28
[r6-LoopBack1]q
[r6]int g 0/0/2
[r6-GigabitEthernet0/0/2]ip address 192.168.1.17 30
[r6-GigabitEthernet0/0/2]q
[r6]int g 4/0/0
[r6-GigabitEthernet4/0/0]ip address 192.168.1.21 30
[r7]int g 0/0/1
[r7-GigabitEthernet0/0/1]ip address 192.168.1.22 30
[r7-GigabitEthernet0/0/1]int g 0/0/0
[r7-GigabitEthernet0/0/0]ip address 192.168.1.18 30
[r7-GigabitEthernet0/0/0]q
[r7]int loopback 0
[r7-LoopBack0]ip address 192.168.1.161 28
[r7-LoopBack0]int l 1
[r7-LoopBack1]ip address 192.168.1.177 28
[r7-LoopBack1]q
[r7]int g 0/0/2
[r7-GigabitEthernet0/0/2]ip address 192.168.1.25 29
[r7-GigabitEthernet0/0/2]q
2.配置静态路由和空接口
[R1]ip route-static 192.168.1.65 28 192.168.1.2
[R1]ip route-static 192.168.1.8 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.20 30 192.168.1.2
[R1]ip route-static 192.168.1.129 28 192.168.1.2
[R1]ip route-static 192.168.1.161 28 192.168.1.2
[R1]ip route-static 192.168.1.12 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.16 30 192.168.1.6
[R1]ip route-static 192.168.1.97 28 192.168.1.6
[R1]ip route-static 192.168.1.161 28 192.168.1.6
[R1]ip route-static 192.168.1.129 28 192.168.1.6
[R1]ip route-static 192.168.1.33 28 NULL 0
[R1]ip route-static 0.0.0.0 0 192.168.1.6
[R2]ip route-static 192.168.1.16 30 192.168.1.10
[R2]ip route-static 192.168.1.20 30 192.168.1.10
[R2]ip route-static 192.168.1.161 28 192.168.1.10
[R2]ip route-static 192.168.1.12 30 192.168.1.10
[R2]ip route-static 192.168.1.129 28 192.168.1.10
[R2]ip route-static 192.168.1.33 28 192.168.1.1
[R2]ip route-static 192.168.1.4 30 192.168.1.1
[R2]ip route-static 192.168.1.97 28 192.168.1.1
[R2]ip route-static 192.168.1.97 28 192.168.1.10
[R2]ip route-static 192.168.1.65 28 NULL 0
[R2]ip route-static 0.0.0.0 0 192.168.1.10
[R3]ip route-static 192.168.1.64 27 192.168.1.14
[R3]ip route-static 192.168.1.8 30 192.168.1.14
[R3]ip route-static 192.168.1.129 28 192.168.1.14
[R3]ip route-static 192.168.1.16 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.161 28 192.168.1.14
[R3]ip route-static 192.168.1.33 28 192.168.1.5
[R3]ip route-static 192.168.1.0 30 192.168.1.5
[R3]ip route-static 192.168.1.65 28 192.168.1.5
[R3]ip route-static 0.0.0.0 0 192.168.1.14
[R4]ip route-static 192.168.1.97 28 192.168.1.13
[R4]ip route-static 192.168.1.4 30 192.168.1.13
[R4]ip route-static 192.168.1.33 28 192.168.1.13
[R4]ip route-static 192.168.1.65 28 192.168.1.9
[R4]ip route-static 192.168.1.0 30 192.168.1.9
[R4]ip route-static 192.168.1.33 28 192.168.1.9
[R4]ip route-static 192.168.1.161 28 192.168.1.18
[R4]ip route-static 192.168.1.161 28 192.168.1.22 preference 61
[R4]ip route-static 192.168.1.129 28 NULL 0
[R4]ip route-static 0.0.0.0 0 192.168.1.18
[R4]ip route-static 0.0.0.0 0 192.168.1.22 preference 61
[R5]ip route-static 192.168.1.129 28 192.168.1.17
[R5]ip route-static 192.168.1.8 30 192.168.1.17
[R5]ip route-static 192.168.1.65 28 192.168.1.17
[R5]ip route-static 192.168.1.0 30 192.168.1.17
[R5]ip route-static 192.168.1.33 28 192.168.1.17
[R5]ip route-static 192.168.1.4 30 192.168.1.17
[R5]ip route-static 192.168.1.12 30 192.168.1.17
[R5]ip route-static 192.168.1.97 28192.168.1.17
[R5]ip route-static 192.168.1.129 28 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.8 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.65 28 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.0 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.33 28 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.4 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.12 30 192.168.1.21 preference 61
[R5]ip route-static 192.168.1.97 28 192.168.1.21 preference 61
[R5]ip route-static 0.0.0.0 0 192.168.1.24
3.对AR3路由器进行DHCP配置。
[R5]dhcp enable
[R5]ip pool huawei
[R5-ip-pool-huawei]gateway-list 192.168.1.25
[R5-ip-pool-huawei]network 192.168.1.26 mask 255.255.255.248
[R5-ip-pool-huawei]dns-list 144.144.144.144 8.8.8.8
[R5]interface GigabitEthernet0/0/2
[R5-GigabitEthernet0/0/2]dhcp select global 
本文档详细介绍了如何配置5个路由器,利用192.168.1.0/24网络,通过静态路由连接6个不同网段。通过设置30位子网,避免IP浪费,同时给出了每个路由器的接口IP地址和环回地址,以及部分路由器的静态路由配置示例。

1124

被折叠的 条评论
为什么被折叠?



