> 文章列表 > 静态路由+DHCP实验(四路由器八PC)

静态路由+DHCP实验(四路由器八PC)

静态路由+DHCP实验(四路由器八PC)

一.200.1.1.0/24子网划分

1.划分八个子网

2.选用前5个,第五个子网再划分4个子网作为骨干

二.规划路由

三.配置(下一跳)

1.先依次实现四个路由器之间全网可通

2.为路由器配置地址池,使用全局模式获取dhcp,指定网关和dns

3.PC测试


 

一.200.1.1.0/24子网划分

1.划分八个子网

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

二.规划路由

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一条

三.配置(下一跳)

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 : StaticDestinations : 5        Routes : 6        Configured Routes : 6Static routing table status : <Active>Destinations : 5        Routes : 6Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface200.1.1.0/27  Static  60   0          RD   200.1.1.129     GigabitEthernet
0/0/1200.1.1.64/27  Static  60   0          RD   200.1.1.138     GigabitEthernet
0/0/0200.1.1.96/27  Static  60   0          RD   200.1.1.129     GigabitEthernet
0/0/1Static  60   0          RD   200.1.1.138     GigabitEthernet
0/0/0200.1.1.144/29  Static  60   0          RD   200.1.1.138     GigabitEthernet
0/0/0200.1.1.152/29  Static  60   0          RD   200.1.1.129     GigabitEthernet
0/0/1Static 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 : StaticDestinations : 5        Routes : 6        Configured Routes : 6Static routing table status : <Active>Destinations : 5        Routes : 6Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface200.1.1.0/27  Static  60   0          RD   200.1.1.146     GigabitEthernet
0/0/0Static  60   0          RD   200.1.1.137     GigabitEthernet
0/0/1200.1.1.32/27  Static  60   0          RD   200.1.1.137     GigabitEthernet
0/0/1200.1.1.96/27  Static  60   0          RD   200.1.1.146     GigabitEthernet
0/0/0200.1.1.128/29  Static  60   0          RD   200.1.1.137     GigabitEthernet
0/0/1200.1.1.152/29  Static  60   0          RD   200.1.1.146     GigabitEthernet
0/0/0Static 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 : StaticDestinations : 5        Routes : 6        Configured Routes : 6Static routing table status : <Active>Destinations : 5        Routes : 6Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface200.1.1.0/27  Static  60   0          RD   200.1.1.154     GigabitEthernet
0/0/0200.1.1.32/27  Static  60   0          RD   200.1.1.154     GigabitEthernet
0/0/0Static  60   0          RD   200.1.1.145     GigabitEthernet
0/0/1200.1.1.64/27  Static  60   0          RD   200.1.1.145     GigabitEthernet
0/0/1200.1.1.128/29  Static  60   0          RD   200.1.1.154     GigabitEthernet
0/0/0200.1.1.136/29  Static  60   0          RD   200.1.1.145     GigabitEthernet
0/0/1Static 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 : StaticDestinations : 5        Routes : 6        Configured Routes : 6Static routing table status : <Active>Destinations : 5        Routes : 6Destination/Mask    Proto   Pre  Cost      Flags NextHop         Interface200.1.1.32/27  Static  60   0          RD   200.1.1.130     GigabitEthernet
0/0/0200.1.1.64/27  Static  60   0          RD   200.1.1.130     GigabitEthernet
0/0/0Static  60   0          RD   200.1.1.153     GigabitEthernet
0/0/1200.1.1.96/27  Static  60   0          RD   200.1.1.153     GigabitEthernet
0/0/1200.1.1.136/29  Static  60   0          RD   200.1.1.130     GigabitEthernet
0/0/0200.1.1.144/29  Static  60   0          RD   200.1.1.153     GigabitEthernet
0/0/1Static 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 s1gateway-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 s2gateway-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 s3gateway-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 s4gateway-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             #PC8Link 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.1148.8.8.8PC>ping 200.1.1.62Ping 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) transmitted3 packet(s) received40.00% packet lossround-trip min/avg/max = 0/83/94 msPC>ping 200.1.1.61Ping 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) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/78/93 msPC>ping 200.1.1.94Ping 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) transmitted1 packet(s) received80.00% packet lossround-trip min/avg/max = 0/78/78 msPC>ping 200.1.1.93Ping 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) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/74/94 msPC>ping 200.1.1.125Ping 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) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/66/78 msPC>ping 200.1.1.126Ping 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) transmitted4 packet(s) received20.00% packet lossround-trip min/avg/max = 0/66/78 ms

投储在线