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

本文介绍了在CCNA环境中,如何通过配置静态路由实现LAN1和LAN2中PC的通信,以及如何通过移除静态路由并设置默认路由达到相同目的。通过在PC1和PC2上设置IP、子网掩码和网关,然后进行通信测试,确保路由配置正确。此外,提供了华为路由器静态路由和默认路由的配置参考链接。

 

实验要求:
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.youkuaiyun.com/qq_34889607/article/details/103858505

评论 1
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值