当前位置: 代码迷 >> 综合 >> CCNA 实验二 静态路由和默认路由
  详细解决方案

CCNA 实验二 静态路由和默认路由

热度:29   发布时间:2023-10-18 11:21:03.0

 

CCNA 实验二 静态路由和默认路由

实验要求:
1、PC1在LAN1中,PC2在LAN2中,配置静态路由实现两个LAN中的PC能够通信; 
2、去掉静态路由,配置默认路由使PC1与PC2能够通信; 

1、PC1在LAN1中,PC2在LAN2中,配置静态路由实现两个LAN中的PC能够通信;

# Router1
Router>enable
Router#configure terminal
Router(config)#hostname R-1
R-1(config)#interface f0/1
R-1(config-if)#ip address 10.10.10.254 255.255.255.0
R-1(config-if)#no shutdown
R-1(config-if)#interface f0/0
R-1(config-if)#ip address 10.10.20.253 255.255.255.0
R-1(config-if)#no shutdown
R-1(config-if)#exit
R-1#show ip interface brief
R-1#show ip route
R-1#configure terminal 
R-1(config)#ip route 10.10.30.0 255.255.255.0 10.10.20.254
R-1(config)#ip route 10.10.40.0 255.255.255.0 10.10.20.254
R-1(config)#exit
R-1#show ip route 
R-1#write
# Router2
Router>enable
Router#configure terminal
Router(config)#hostname R-2
R-2(config)#interface f0/0
R-2(config-if)#ip address 10.10.20.254 255.255.255.0
R-2(config-if)#no shutdown
R-2(config-if)#interface f0/1
R-2(config-if)#ip address 10.10.30.253 255.255.255.0
R-2(config-if)#no shutdown 
R-2(config-if)#exit
R-2#show ip interface brief
R-2#show ip route
R-2#configure terminal
R-2(config)#ip route 10.10.10.0 255.255.255.0 10.10.20.253
R-2(config)#ip route 10.10.40.0 255.255.255.0 10.10.30.254
R-2(config)#exit
R-2#show ip route 
R-2#write
# Router3
Router>enable
Router#configure terminal
Router(config)#hostname R-3
R-3(config)#interface f0/1
R-3(config-if)#ip address 10.10.30.254 255.255.255.0
R-3(config-if)#no shutdown 
R-3(config-if)#interface f0/0
R-3(config-if)#ip address 10.10.40.254 255.255.255.0
R-3(config-if)#no shutdown 
R-3(config-if)#exit
R-3#show ip interface brief
R-3#show ip route
R-3#configure terminal
R-3(config)#ip route 10.10.10.0 255.255.255.0 10.10.30.253
R-3(config)#ip route 10.10.20.0 255.255.255.0 10.10.30.253
R-3(config)#exit
R-3#show ip route 
R-3#write

2、去掉静态路由,配置默认路由使PC1与PC2能够通信; 

首先,需要取消之前设置的静态路由
# Router1
R-1>enable
R-1#show ip route
R-1#configure terminal 
R-1(config)#no ip route 10.10.30.0 255.255.255.0 10.10.20.254
R-1(config)#no ip route 10.10.40.0 255.255.255.0 10.10.20.254
R-1(config)#exit
R-1#show ip route
R-1#write# Router2
R-2>enable
R-2#show ip route
R-2#configure terminal 
R-2(config)#no ip route 10.10.10.0 255.255.255.0 10.10.20.253
R-2(config)#no ip route 10.10.40.0 255.255.255.0 10.10.30.254
R-2(config)#exit
R-2#show ip route
R-2#write# Router3
R-3>enable
R-3#show ip route
R-3#configure terminal 
R-3(config)#no ip route 10.10.10.0 255.255.255.0 10.10.30.253
R-3(config)#no ip route 10.10.20.0 255.255.255.0 10.10.30.253
R-3(config)#exit
R-3#show ip route
R-3#write
下面开始配置默认路由
# Router1
R-1#configure terminal 
R-1(config)#
R-1(config)#ip r
R-1(config)#ip route 0.0.0.0 0.0.0.0 10.10.20.254
R-1(config)#exit
R-1#show ip route
R-1#write# Router2
R-2#configure terminal 
R-2(config)#ip route 0.0.0.0 0.0.0.0 10.10.20.253
R-2(config)#ip route 0.0.0.0 0.0.0.0 10.10.30.254
R-2(config)#exit
R-2#show ip route
R-2#write# Router3
R-3#configure terminal 
R-3(config)#ip route 0.0.0.0 0.0.0.0 10.10.30.253
R-3(config)#exit
R-3#show ip route
R-3#write

 

pc1、pc2 设置好ip、子网掩码、网关后,进行相应测试,这里就不一一列举出来了。

 

华为路由器配置静态路由&默认路由请参考:https://blog.csdn.net/qq_34889607/article/details/103858505