静态路由和默认路由的实验方法

2019-03-2821:08:54计算机网络技术Comments2,632 views字数 3709阅读模式

通过本实验,需要掌握以下技能:文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

1)    路由表的概念
2)    IP route 命令的使用
3)    根据需求正确配置静态路由
4)    根据需求使用默认路由文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

拓扑结构文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

静态路由和默认路由的实验方法文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

实现,  2.2.2.0/24, /24网络之间能互相通信文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

实验步骤
n    步骤1:在各路由器上配置IP 地址、保证直连链路的连通性
R2(config)#int loopback0
R2(config-if)#ip address 2.2.2.2
R2(config)#int s1/0
R2(config-if)#ip address 12.1.1.2
R2(config-if)#no shutdown文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

R1(config)#int loopback0
R1(config-if)#ip address 1.1.1.1
R1(config)#int s1/0
R1(config-if)#clock rate 64000
R1(config-if)#ip address
R1(config-if)#no shutdown
R1(config)#int s1/1
R1(config-if)#clock rate 64000
R1(config-if)#ip address 13.1.1.1
R1(config-if)#no shutdown文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

R3(config)#int loopback0
R3(config-if)#ip address
R3(config)#int s1/1
R3(config-if)#ip address 13.1.1.3
R3(config-if)#no shutdown文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

n    步骤2:R2 上配置静态路由
R2(config)#ip route 1.1.1.0    s1/0
// 下一跳为接口形式,s1/0是点到点的链路,注意应该是R2上的s1/0
R2(config)#ip route
// 下一跳为IP地址形式,是R1上的IP地址
n    步骤3:R1 上配置静态路由
R1(config)#ip route 2.2.2.0 s1/0
R1(config)#ip route s1/1文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

n    步骤4:R3 上配置静态路由
R3(config)#ip route 1.1.1.0 s1/1
R3(config)#ip route 2.2.2.0 s1/1文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

实验调试
n    在R2,R1,R3上查看路由表
R2#show ip route
Codes: 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文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

Gateway of last resort is not set文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

1.0.0.0/24 is subnetted, 1 subnets
S       1.1.1.0 is directly connected, Serial1/0
2.0.0.0/24 is subnetted, 1 subnets
C       2.2.2.0 is directly connected, Loopback0
3.0.0.0/24 is subnetted, 1 subnets
S       [1/0] via
12.0.0.0/24 is subnetted, 1 subnets
C       is directly connected, Serial1/0文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

R1#show ip route文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

Codes: 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文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

Gateway of last resort is not set文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

1.0.0.0/24 is subnetted, 1 subnets
C       1.1.1.0 is directly connected, Loopback0
2.0.0.0/24 is subnetted, 1 subnets
S       2.2.2.0 is directly connected, Serial1/0
3.0.0.0/24 is subnetted, 1 subnets
S       is directly connected, Serial1/1
12.0.0.0/24 is subnetted, 1 subnets
C       is directly connected, Serial1/0
13.0.0.0/24 is subnetted, 1 subnets
C       13.1.1.0 is directly connected, Serial1/1文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

R3#show ip route
Codes: 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文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

Gateway of last resort is not set文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

1.0.0.0/24 is subnetted, 1 subnets
S       1.1.1.0 is directly connected, Serial1/1
2.0.0.0/24 is subnetted, 1 subnets
S       2.2.2.0 is directly connected, Serial1/1
3.0.0.0/24 is subnetted, 1 subnets
C       is directly connected, Loopback0
13.0.0.0/24 is subnetted, 1 subnets
C       13.1.1.0 is directly connected, Serial1/1文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

n      在各路由器上ping其它路由器的环回口
R2#ping 1.1.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 1.1.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/20/60 ms
R2#ping
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)
R2#ping source 2.2.2.2文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to , timeout is 2 seconds:
Packet sent with a source address of 2.2.2.2
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/44/92 ms文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

【实验结论】
1)    各路由器上ping loopback地址所在的直连网段都能通
2)    R1上ping 2.2.2.2和都能通
3)    R2上ping 和R3上ping 2.2.2.2是不通的,但R2上ping source 2.2.2.2和R3上ping 2.2.2.2 source 能通
【提示】
用ping测试不设置源IP地址,默认以接口地址为源地址,查看R3的路由表,没有到目标网段的路由条目,故R3无法响应R2的报文
【解决方法】
R3(config)#ip route s1/1
R3(config)#ip route 0.0.0.0 0.0.0.0 s1/1文章源自菜鸟学院-https://www.cainiaoxueyuan.com/wangluo/10531.html

  • 本站内容整理自互联网,仅提供信息存储空间服务,以方便学习之用。如对文章、图片、字体等版权有疑问,请在下方留言,管理员看到后,将第一时间进行处理。
  • 转载请务必保留本文链接:https://www.cainiaoxueyuan.com/wangluo/10531.html

Comment

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定