目录
(2)为路由器配置地址池,使用全局模式获取dhcp,指定网关和dns
一.静态路由+DHCP
1.子网划分
(1)200.1.1.0/24划分八个子网
200.1.1.0/27
200.1.1.32/27
200.1.1.64/27
200.1.1.96/27
200.1.1.128/27
200.1.1.160/27
200.1.1.192/27
200.1.1..224/27
(2)选用前5个,第五个子网再划分4个子网作为骨干
200.1.1.128/29
200.1.1.136/29
200.1.1.144/29
200.1.1.152/29
2.规划路由
AR1:
到达200.1.1.0/27一条
到达200.1.1.64/27一条
到达200.1.1.96/27两条
到达200.1.1.144/29一条
到达200.1.1.152/29一条
AR2:
到达200.1.1.0/27两条
到达200.1.1.32/27一条
到达200.1.1.96/27一条
到达200.1.1.128/29一条
到达200.1.1.152/29一条
AR3:
到达200.1.1.32/27两条
到达200.1.1.64/27一条
到达200.1.1.0/27一条
到达200.1.1.128/29一条
到达200.1.1.136/29一条
AR4:
到达200.1.1.64/27两条
到达200.1.1.32/27一条
到达200.1.1.64/27一条
到达200.1.1.136/29一条
到达200.1.1.144/29一条
3.配置(下一跳)
(1)先依次实现四个路由器之间全网可通
[Huawei]ip route-static 200.1.1.136 29 200.1.1.130
#根据规划路由依次写静态路由实现通信
AR1:
[r1]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 5 Routes : 6 Configured Routes : 6
Static routing table status : <Active>
Destinations : 5 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
200.1.1.0/27 Static 60 0 RD 200.1.1.129 GigabitEthernet
0/0/1
200.1.1.64/27 Static 60 0 RD 200.1.1.138 GigabitEthernet
0/0/0
200.1.1.96/27 Static 60 0 RD 200.1.1.129 GigabitEthernet
0/0/1
Static 60 0 RD 200.1.1.138 GigabitEthernet
0/0/0
200.1.1.144/29 Static 60 0 RD 200.1.1.138 GigabitEthernet
0/0/0
200.1.1.152/29 Static 60 0 RD 200.1.1.129 GigabitEthernet
0/0/1
Static routing table status : <Inactive>
Destinations : 0 Routes : 0
AR2:
[r2]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 5 Routes : 6 Configured Routes : 6
Static routing table status : <Active>
Destinations : 5 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
200.1.1.0/27 Static 60 0 RD 200.1.1.146 GigabitEthernet
0/0/0
Static 60 0 RD 200.1.1.137 GigabitEthernet
0/0/1
200.1.1.32/27 Static 60 0 RD 200.1.1.137 GigabitEthernet
0/0/1
200.1.1.96/27 Static 60 0 RD 200.1.1.146 GigabitEthernet
0/0/0
200.1.1.128/29 Static 60 0 RD 200.1.1.137 GigabitEthernet
0/0/1
200.1.1.152/29 Static 60 0 RD 200.1.1.146 GigabitEthernet
0/0/0
Static routing table status : <Inactive>
Destinations : 0 Routes : 0
AR3:
[r3]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 5 Routes : 6 Configured Routes : 6
Static routing table status : <Active>
Destinations : 5 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
200.1.1.0/27 Static 60 0 RD 200.1.1.154 GigabitEthernet
0/0/0
200.1.1.32/27 Static 60 0 RD 200.1.1.154 GigabitEthernet
0/0/0
Static 60 0 RD 200.1.1.145 GigabitEthernet
0/0/1
200.1.1.64/27 Static 60 0 RD 200.1.1.145 GigabitEthernet
0/0/1
200.1.1.128/29 Static 60 0 RD 200.1.1.154 GigabitEthernet
0/0/0
200.1.1.136/29 Static 60 0 RD 200.1.1.145 GigabitEthernet
0/0/1
Static routing table status : <Inactive>
Destinations : 0 Routes : 0
AR4:
[r4]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 5 Routes : 6 Configured Routes : 6
Static routing table status : <Active>
Destinations : 5 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
200.1.1.32/27 Static 60 0 RD 200.1.1.130 GigabitEthernet
0/0/0
200.1.1.64/27 Static 60 0 RD 200.1.1.130 GigabitEthernet
0/0/0
Static 60 0 RD 200.1.1.153 GigabitEthernet
0/0/1
200.1.1.96/27 Static 60 0 RD 200.1.1.153 GigabitEthernet
0/0/1
200.1.1.136/29 Static 60 0 RD 200.1.1.130 GigabitEthernet
0/0/0
200.1.1.144/29 Static 60 0 RD 200.1.1.153 GigabitEthernet
0/0/1
Static routing table status : <Inactive>
Destinations : 0 Routes : 0
(2)为路由器配置地址池,使用全局模式获取dhcp,指定网关和dns
[r1]dhcp enable
[r1]ip pool s1
[r1-ip-pool-s1]network 200.1.1.32 mask 27
[r1-ip-pool-s1]dns-list 114.114.114.114 8.8.8.8
[r1-ip-pool-s1]gateway-list 200.1.1.33
[r1]interface GigabitEthernet 0/0/2
[r1-GigabitEthernet0/0/2]dhcp select global
#四个路由器同样做此配置
AR1:
[r1]ip pool s1
[r1-ip-pool-s1]display this
[V200R003C00]
#
ip pool s1
gateway-list 200.1.1.33
network 200.1.1.32 mask 255.255.255.224
dns-list 114.114.114.114 8.8.8.8
#
return
AR2:
[r2]ip pool S2
[r2-ip-pool-s2]display this
[V200R003C00]
#
ip pool s2
gateway-list 200.1.1.65
network 200.1.1.64 mask 255.255.255.224
dns-list 114.114.114.114 8.8.8.8
#
return
AR3:
[r3]ip pool s3
[r3-ip-pool-s3]display this
[V200R003C00]
#
ip pool s3
gateway-list 200.1.1.97
network 200.1.1.96 mask 255.255.255.224
dns-list 114.114.114.114 8.8.8.8
#
return
AR4:
[r4]ip pool s4
[r4-ip-pool-s4]dis
[r4-ip-pool-s4]display th
[r4-ip-pool-s4]display this
[V200R003C00]
#
ip pool s4
gateway-list 200.1.1.1
network 200.1.1.0 mask 255.255.255.224
dns-list 114.114.114.114 8.8.8.8
#
return
(3)PC测试
PC>ipconfig #PC8
Link local IPv6 address...........: fe80::5689:98ff:fe61:7b69
IPv6 address......................: :: / 128
IPv6 gateway......................: ::
IPv4 address......................: 200.1.1.29
Subnet mask.......................: 255.255.255.224
Gateway...........................: 200.1.1.1
Physical address..................: 54-89-98-61-7B-69
DNS server........................: 114.114.114.114
8.8.8.8
PC>ping 200.1.1.62
Ping 200.1.1.62: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
From 200.1.1.62: bytes=32 seq=3 ttl=126 time=78 ms
From 200.1.1.62: bytes=32 seq=4 ttl=126 time=78 ms
From 200.1.1.62: bytes=32 seq=5 ttl=126 time=94 ms
--- 200.1.1.62 ping statistics ---
5 packet(s) transmitted
3 packet(s) received
40.00% packet loss
round-trip min/avg/max = 0/83/94 ms
PC>ping 200.1.1.61
Ping 200.1.1.61: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 200.1.1.61: bytes=32 seq=2 ttl=126 time=62 ms
From 200.1.1.61: bytes=32 seq=3 ttl=126 time=79 ms
From 200.1.1.61: bytes=32 seq=4 ttl=126 time=93 ms
From 200.1.1.61: bytes=32 seq=5 ttl=126 time=78 ms
--- 200.1.1.61 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/78/93 ms
PC>ping 200.1.1.94
Ping 200.1.1.94: 32 data bytes, Press Ctrl_C to break
Request timeout!
Request timeout!
Request timeout!
Request timeout!
From 200.1.1.94: bytes=32 seq=5 ttl=125 time=78 ms
--- 200.1.1.94 ping statistics ---
5 packet(s) transmitted
1 packet(s) received
80.00% packet loss
round-trip min/avg/max = 0/78/78 ms
PC>ping 200.1.1.93
Ping 200.1.1.93: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 200.1.1.93: bytes=32 seq=2 ttl=125 time=94 ms
From 200.1.1.93: bytes=32 seq=3 ttl=125 time=46 ms
From 200.1.1.93: bytes=32 seq=4 ttl=125 time=79 ms
From 200.1.1.93: bytes=32 seq=5 ttl=125 time=78 ms
--- 200.1.1.93 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/74/94 ms
PC>ping 200.1.1.125
Ping 200.1.1.125: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 200.1.1.125: bytes=32 seq=2 ttl=126 time=78 ms
From 200.1.1.125: bytes=32 seq=3 ttl=126 time=78 ms
From 200.1.1.125: bytes=32 seq=4 ttl=126 time=47 ms
From 200.1.1.125: bytes=32 seq=5 ttl=126 time=62 ms
--- 200.1.1.125 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/66/78 ms
PC>ping 200.1.1.126
Ping 200.1.1.126: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 200.1.1.126: bytes=32 seq=2 ttl=126 time=62 ms
From 200.1.1.126: bytes=32 seq=3 ttl=126 time=78 ms
From 200.1.1.126: bytes=32 seq=4 ttl=126 time=63 ms
From 200.1.1.126: bytes=32 seq=5 ttl=126 time=62 ms
--- 200.1.1.126 ping statistics ---
5 packet(s) transmitted
4 packet(s) received
20.00% packet loss
round-trip min/avg/max = 0/66/78 ms
二.四路由器静态路由(原理基本同上)
1.规划路由条数:
AR1:
(1)到达2.2.2.0/24
(2)到达3.3.3.0/24
(3)到达4.4.4.0/24
(4)到达13.1.1.0/24
(5)到达14.1.1.0/24
AR2:
(1)到达1.1.1.0/24
(2)到达3.3.3.0/24
(3)到达4.4.4.0/24
(4)到达14.1.1.0/24
(5)到达15.1.1.0/24
AR3:
(1)到达1.1.1.0/24
(2)到达2.2.2.0./24
(3)到达4.4.4.0/24
(4)到达12.1.1.0/24
(5)到达15.1.1.0/24
AR4:
(1)到达2.2.2.0/24
(2)到达3.3.3.0/24
(3)到达1.1.1.0/24
(4)到达12.1.1.0/24
(5)到达13.1.1.0/24
2.配置路由器(下一跳方式)
(1)先为路由器配好IP和环回
[Huawei]interface LoopBack 0
[Huawei-LoopBack0]ip address xx.xx.xx.xx xx
[Huawei]interface GigabitEthernet 0/0/0
[Huawei-GigabitEthernet0/0/0]ip address xx.xx.xx.xx xx
AR1:
[Huawei]display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.1.1.1/24 up up
GigabitEthernet0/0/1 15.1.1.2/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 1.1.1.1/24 up up(s)
AR2:
<Huawei>display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.1.1.2/24 up up
GigabitEthernet0/0/1 13.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 2.2.2.2/24 up up(s)
AR3:
<Huawei>display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 12.1.1.2/24 up up
GigabitEthernet0/0/1 13.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 2.2.2.2/24 up up(s)
AR4:
<Huawei>display ip interface brief
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 4
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 4
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 14.1.1.2/24 up up
GigabitEthernet0/0/1 15.1.1.1/24 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 4.4.4.4/24 up up(s)
(2)根据规划条数配置静态路由
环回:
[Huawei]ip route-static 2.2.2.0 255.255.255.0 12.1.1.2
#目标网段 下一跳接口
接口:
[Huawei]ip route-static 2.2.2.0 255.255.255.0 12.1.1.2
注意配置来回(收发)线路,否则不通信
(3)测试
AR1:
[Huawei]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 5 Routes : 6 Configured Routes : 6
Static routing table status : <Active>
Destinations : 5 Routes : 6
Destination/Mask Proto Pre Cost Flags NextHop Interface
2.2.2.0/24 Static 60 0 RD 12.1.1.2 GigabitEthernet
0/0/0
3.3.3.0/24 Static 60 0 RD 12.1.1.2 GigabitEthernet
0/0/0
Static 60 0 RD 15.1.1.1 GigabitEthernet
0/0/1
4.4.4.0/24 Static 60 0 RD 15.1.1.1 GigabitEthernet
0/0/1
13.1.1.0/24 Static 60 0 RD 12.1.1.2 GigabitEthernet
0/0/0
14.1.1.0/24 Static 60 0 RD 15.1.1.1 GigabitEthernet
0/0/1
Static routing table status : <Inactive>
Destinations : 0 Routes : 0
AR2:
[Huawei]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 5 Routes : 5 Configured Routes : 5
Static routing table status : <Active>
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Static 60 0 RD 12.1.1.1 GigabitEthernet
0/0/0
3.3.3.0/24 Static 60 0 RD 13.1.1.2 GigabitEthernet
0/0/1
4.4.4.0/24 Static 60 0 RD 12.1.1.1 GigabitEthernet
0/0/0
14.1.1.0/24 Static 60 0 RD 13.1.1.2 GigabitEthernet
0/0/1
15.1.1.0/24 Static 60 0 RD 12.1.1.1 GigabitEthernet
0/0/0
Static routing table status : <Inactive>
Destinations : 0 Routes : 0
AR3:
[Huawei]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 5 Routes : 5 Configured Routes : 5
Static routing table status : <Active>
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Static 60 0 RD 13.1.1.1 GigabitEthernet
0/0/1
2.2.2.0/24 Static 60 0 RD 13.1.1.1 GigabitEthernet
0/0/1
4.4.4.0/24 Static 60 0 RD 14.1.1.2 GigabitEthernet
0/0/0
12.1.1.0/24 Static 60 0 RD 13.1.1.1 GigabitEthernet
0/0/1
15.1.1.0/24 Static 60 0 RD 14.1.1.2 GigabitEthernet
0/0/0
Static routing table status : <Inactive>
Destinations : 0 Routes : 0
AR4:
[Huawei]display ip routing-table protocol static
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Public routing table : Static
Destinations : 5 Routes : 5 Configured Routes : 5
Static routing table status : <Active>
Destinations : 5 Routes : 5
Destination/Mask Proto Pre Cost Flags NextHop Interface
1.1.1.0/24 Static 60 0 RD 15.1.1.2 GigabitEthernet
0/0/1
2.2.2.0/24 Static 60 0 RD 15.1.1.2 GigabitEthernet
0/0/1
3.3.3.0/24 Static 60 0 RD 14.1.1.1 GigabitEthernet
0/0/0
12.1.1.0/24 Static 60 0 RD 15.1.1.2 GigabitEthernet
0/0/1
13.1.1.0/24 Static 60 0 RD 14.1.1.1 GigabitEthernet
0/0/0
Static routing table status : <Inactive>
Destinations : 0 Routes : 0