拓扑图
实验需求:
1、整张网络使用192.168.1.0/24网段进行划分
2、RI、R2、R3、R4均有两个环回来模拟用户网段
3、R5使用DHCP为PC分配IP地址
4、R2、R3、R4、R5开启Telnet功能;账号密码:admin/admin
5、完成所有路由器的静态路由配置,要求使用最简化路由表的方式
6、全网可达
需求分析
1,首先对192.168.1.0/24进行子网划分
2,对所有服务器的IP地址进行手工配置
3,R5服务器使用DHCP为pc分配IP,r5使用地址池进行分配
4,R2、R3、R4、R5开启Telnet功能
5、完成所有路由器的静态路由配置,要求使用最简化路由表的方式
实验步骤:
1,首先进行子网划分,根据拓扑图中信息可知,拓扑图中共有7个广播域,加上RI、R2、R3、R4均有两个环回来模拟用户网段,所以我们共需15个网段进行配置
2,对r1 r2 r3 r4 r5ip进行配置
r1
[r1]display ip interface b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.1/30 up up
GigabitEthernet0/0/1 192.168.1.5/30 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.33/28 up up(s)
LoopBack1 192.168.1.49/28 up up(s)
NULL0 unassigned up up(s)
r2:
[r2]display ip interface b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.2/30 up up
GigabitEthernet0/0/1 192.168.1.9/30 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.65/28 up up(s)
LoopBack1 192.168.1.81/28 up up(s)
NULL0 unassigned up up(s
r3 :
[r3-LoopBack1]display ip interface b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 5
The number of interface that is DOWN in Physical is 1
The number of interface that is UP in Protocol is 5
The number of interface that is DOWN in Protocol is 1
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.13/30 up up
GigabitEthernet0/0/1 192.168.1.6/30 up up
GigabitEthernet0/0/2 unassigned down down
LoopBack0 192.168.1.97/28 up up(s)
LoopBack1 192.168.1.113/28 up up(s)
NULL0 unassigned up up(s)
r4:
[r4-LoopBack1]display ip interface b
*down: administratively down
^down: standby
(l): loopback
(s): spoofing
The number of interface that is UP in Physical is 7
The number of interface that is DOWN in Physical is 0
The number of interface that is UP in Protocol is 7
The number of interface that is DOWN in Protocol is 0
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.17/30 up up
GigabitEthernet0/0/1 192.168.1.21/30 up up
GigabitEthernet0/0/2 192.168.1.14/30 up up
GigabitEthernet4/0/0 192.168.1.10/30 up up
LoopBack0 192.168.1.129/28 up up(s)
LoopBack1 192.168.1.145/28 up up(s)
NULL0 unassigned up up(s)
r5
Interface IP Address/Mask Physical Protocol
GigabitEthernet0/0/0 192.168.1.18/30 up up
GigabitEthernet0/0/1 192.168.1.22/30 up up
GigabitEthernet0/0/2 192.168.1.161/27 up up
NULL0 unassigned up up(s)
3,为pc分配IP
pc1
pc2
4,R2、R3、R4、R5开启Telnet功能
<r1>telnet 192.168.1.2
Press CTRL_] to quit telnet mode
Trying 192.168.1.2 ...
Connected to 192.168.1.2 ...
Login authentication
Username:admin
Password:
Error: Local authentication is rejected.
以此类推
5 完成所有路由器的静态路由配置,要求使用最简化路由表的方式
这是r1 配置
[r1]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 21 Routes : 22
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/30 Direct 0 0 D 192.168.1.1 GigabitEthernet
0/0/0
192.168.1.1/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.4/30 Direct 0 0 D 192.168.1.5 GigabitEthernet
0/0/1
192.168.1.5/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.7/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.8/30 Static 60 0 RD 192.168.1.2 GigabitEthernet
0/0/0
192.168.1.12/30 Static 60 0 RD 192.168.1.6 GigabitEthernet
0/0/1
192.168.1.32/28 Direct 0 0 D 192.168.1.33 LoopBack0
192.168.1.33/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.47/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.48/28 Direct 0 0 D 192.168.1.49 LoopBack1
192.168.1.49/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.63/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.64/27 Static 60 0 RD 192.168.1.2 GigabitEthernet
0/0/0
192.168.1.96/27 Static 60 0 RD 192.168.1.6 GigabitEthernet
0/0/1
192.168.1.128/27 Static 60 0 RD 192.168.1.2 GigabitEthernet
0/0/0
Static 60 0 RD 192.168.1.6 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
r2
[r2]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 21 Routes : 22
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/30 Direct 0 0 D 192.168.1.2 GigabitEthernet
0/0/0
192.168.1.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.4/30 Static 60 0 RD 192.168.1.1 GigabitEthernet
0/0/0
192.168.1.8/30 Direct 0 0 D 192.168.1.9 GigabitEthernet
0/0/1
192.168.1.9/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.11/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.12/30 Static 60 0 RD 192.168.1.10 GigabitEthernet
0/0/1
192.168.1.32/27 Static 60 0 RD 192.168.1.1 GigabitEthernet
0/0/0
192.168.1.64/28 Direct 0 0 D 192.168.1.65 LoopBack0
192.168.1.65/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.79/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.80/28 Direct 0 0 D 192.168.1.81 LoopBack1
192.168.1.81/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.95/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.96/27 Static 60 0 RD 192.168.1.1 GigabitEthernet
0/0/0
Static 60 0 RD 192.168.1.10 GigabitEthernet
0/0/1
192.168.1.128/27 Static 60 0 RD 192.168.1.10 GigabitEthernet
0/0/1
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
[r2]
r3
[r3]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 21 Routes : 22
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/30 Static 60 0 RD 192.168.1.5 GigabitEthernet
0/0/1
192.168.1.4/30 Direct 0 0 D 192.168.1.6 GigabitEthernet
0/0/1
192.168.1.6/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.7/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.8/30 Static 60 0 RD 192.168.1.14 GigabitEthernet
0/0/0
192.168.1.12/30 Direct 0 0 D 192.168.1.13 GigabitEthernet
0/0/0
192.168.1.13/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.15/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.32/27 Static 60 0 RD 192.168.1.5 GigabitEthernet
0/0/1
192.168.1.64/27 Static 60 0 RD 192.168.1.5 GigabitEthernet
0/0/1
Static 60 0 RD 192.168.1.14 GigabitEthernet
0/0/0
192.168.1.96/28 Direct 0 0 D 192.168.1.97 LoopBack0
192.168.1.97/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.111/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.112/28 Direct 0 0 D 192.168.1.113 LoopBack1
192.168.1.113/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.127/32 Direct 0 0 D 127.0.0.1 LoopBack1
192.168.1.128/27 Static 60 0 RD 192.168.1.14 GigabitEthernet
0/0/0
255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
r4
[r4]display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
Destinations : 27 Routes : 28
Destination/Mask Proto Pre Cost Flags NextHop Interface
127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0
127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0
127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0
192.168.1.0/30 Static 60 0 RD 192.168.1.9 GigabitEthernet
4/0/0
192.168.1.4/30 Static 60 0 RD 192.168.1.13 GigabitEthernet
0/0/2
192.168.1.8/30 Direct 0 0 D 192.168.1.10 GigabitEthernet
4/0/0
192.168.1.10/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
4/0/0
192.168.1.11/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
4/0/0
192.168.1.12/30 Direct 0 0 D 192.168.1.14 GigabitEthernet
0/0/2
192.168.1.14/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.15/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/2
192.168.1.16/30 Direct 0 0 D 192.168.1.17 GigabitEthernet
0/0/0
192.168.1.17/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.19/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/0
192.168.1.20/30 Direct 0 0 D 192.168.1.21 GigabitEthernet
0/0/1
192.168.1.21/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.23/32 Direct 0 0 D 127.0.0.1 GigabitEthernet
0/0/1
192.168.1.32/27 Static 60 0 RD 192.168.1.9 GigabitEthernet
4/0/0
Static 60 0 RD 192.168.1.13 GigabitEthernet
0/0/2
192.168.1.64/27 Static 60 0 RD 192.168.1.9 GigabitEthernet
4/0/0
192.168.1.96/27 Static 60 0 RD 192.168.1.13 GigabitEthernet
0/0/2
192.168.1.128/28 Direct 0 0 D 192.168.1.129 LoopBack0
192.168.1.129/32 Direct 0 0 D 127.0.0.1 LoopBack0
192.168.1.143/32 Direct 0 0 D 127.0.0.1 LoopBack0
最后ping成功
[r4]ping 192.168.1.97
PING 192.168.1.97: 56 data bytes, press CTRL_C to break
Reply from 192.168.1.97: bytes=56 Sequence=1 ttl=255 time=20 ms
Reply from 192.168.1.97: bytes=56 Sequence=2 ttl=255 time=20 ms
Reply from 192.168.1.97: bytes=56 Sequence=3 ttl=255 time=30 ms
Reply from 192.168.1.97: bytes=56 Sequence=4 ttl=255 time=20 ms
Reply from 192.168.1.97: bytes=56 Sequence=5 ttl=255 time=30 ms
--- 192.168.1.97 ping statistics ---
5 packet(s) transmitted
5 packet(s) received
0.00% packet loss
round-trip min/avg/max = 20/24/30 ms
以此类推ping其他设备也可以