CCNA课程实验-07-Static_Routing

实验条件

网络拓朴

在这里插入图片描述

需求

  1. PC1在LAN1中,PC2在LAN2中,配置静态路由实现两个LAN中的PC能够通信;
  2. 去掉R1和R3上刚刚配置的静态路由,配置默认路由使PC1与PC2能够通信;

配置实现

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

PC1

PC1(config)#no ip routing	// 关闭ip路由
PC1(config)#int e0/0
PC1(config-if)#ip address 192.168.10.1 255.255.255.0 
PC1(config-if)#no shutdown
PC1(config-if)#exit
PC1(config)#ip default-gateway 192.168.10.254
PC1(config)#do show ip route
Default gateway is 192.168.10.254

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty
PC1(config)#

PC2

PC2(config)#no ip routing	// 关闭ip路由
PC2(config)#int e0/0
PC2(config-if)#ip address 192.168.20.1 255.255.255.0 
PC2(config-if)#no shutdown
PC2(config-if)#exit
PC2(config)#ip default-gateway 192.168.20.254
PC2(config)#do show ip route
Default gateway is 192.168.20.254

Host               Gateway           Last Use    Total Uses  Interface
ICMP redirect cache is empty
PC2(config)#

R1

R1(config)#ip route 192.168.20.0 255.255.255.0 12.1.1.2
R1(config)#do show ip route                            
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.1.1.0/24 is directly connected, Ethernet0/1
L        12.1.1.1/32 is directly connected, Ethernet0/1
      192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.10.0/24 is directly connected, Ethernet0/0
L        192.168.10.254/32 is directly connected, Ethernet0/0
S     192.168.20.0/24 [1/0] via 12.1.1.2
R1(config)#

R2

R2(config)#ip route 192.168.20.0 255.255.255.0 23.1.1.3
R2(config)#do show ip route                            
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.1.1.0/24 is directly connected, Ethernet0/1
L        12.1.1.2/32 is directly connected, Ethernet0/1
      23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        23.1.1.0/24 is directly connected, Ethernet0/0
L        23.1.1.2/32 is directly connected, Ethernet0/0
S     192.168.10.0/24 [1/0] via 12.1.1.1
S     192.168.20.0/24 [1/0] via 23.1.1.3
R2(config)#

R3

R3(config)#ip route 192.168.10.0 255.255.255.0 23.1.1.2
R3(config)#do show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is not set

      23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        23.1.1.0/24 is directly connected, Ethernet0/0
L        23.1.1.3/32 is directly connected, Ethernet0/0
S     192.168.10.0/24 [1/0] via 23.1.1.2
      192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.20.0/24 is directly connected, Ethernet0/1
L        192.168.20.254/32 is directly connected, Ethernet0/1
R3(config)#
PC1>ping 192.168.20.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 2/2/2 ms
PC1>

PC2>ping 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/3 ms
PC2>

去掉R1和R3上刚刚配置的静态路由,配置默认路由使PC1与PC2能够通信;

SW1

R1(config)#no ip route 192.168.20.0 255.255.255.0
R1(config)#ip route 0.0.0.0 0.0.0.0 12.1.1.2
R1(config)#do show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is 12.1.1.2 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 12.1.1.2
      12.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        12.1.1.0/24 is directly connected, Ethernet0/1
L        12.1.1.1/32 is directly connected, Ethernet0/1
      192.168.10.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.10.0/24 is directly connected, Ethernet0/0
L        192.168.10.254/32 is directly connected, Ethernet0/0
R1(config)#

SW3

R3(config)#no ip route 192.168.10.0 255.255.255.0
R3(config)#ip route 0.0.0.0 0.0.0.0 23.1.1.2 
R3(config)#do show ip route
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
       ia - IS-IS inter area, * - candidate default, U - per-user static route
       o - ODR, P - periodic downloaded static route, H - NHRP, l - LISP
       a - application route
       + - replicated route, % - next hop override, p - overrides from PfR

Gateway of last resort is 23.1.1.2 to network 0.0.0.0

S*    0.0.0.0/0 [1/0] via 23.1.1.2
      23.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C        23.1.1.0/24 is directly connected, Ethernet0/0
L        23.1.1.3/32 is directly connected, Ethernet0/0
      192.168.20.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.20.0/24 is directly connected, Ethernet0/1
L        192.168.20.254/32 is directly connected, Ethernet0/1
R3(config)#

结果OK

PC1>ping 192.168.20.1 
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 2/2/3 ms
PC1>

PC2>ping 192.168.10.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/7/20 ms
PC2>
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

烈火蜓蜻

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值