美文网首页
思科设备静态路由配置

思科设备静态路由配置

作者: 搞IT青年小唐唐 | 来源:发表于2017-01-31 19:09 被阅读0次

1.静态路由的工作原理及应用场景

2.默认路由的应用场景及配置方法

3.静态浮动路由的应用场景及配置方法

实验拓扑图

正常情况下c1和c2通过交换机直连就可以通,但是c1和c2和c3都通信不了,因为

它们不在一个网段。需要在R1上面设置两个口f0/0和f0/1 ip ,即c1 c2 和c3的网关,这样c1才能Ping通c3.数据包c1->sw1-》f0/0 查看R1路由表(给R1路由器配置ip地址记得加ip add ,配置完ip 记得no shut启动,路由器互相ping端口的时候记得前面加do  ping,R2(config-if)#do ping 192.168.2.1)

配置好后查看R1路由表R1#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

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, FastEthernet0/0

C    192.168.2.0/24 is directly connected, FastEthernet0/1

实验拓扑2

c1 ping 192.168.2.2不通行走路线

c1 pingR2f0/0 c1会先到R1,R1会查看路由表,有到192.168.2.2的网段

查看R2是否收到pc1发过来的数据命令

R2#debug ip icmp

ICMP packet debugging is on

R2#

*Mar  1 00:39:22.971: ICMP: echo reply sent, src 192.168.2.2, dst 192.168.1.20

R2#show ip route发现左侧和右侧f0/0和f0/1怎么走,但是没有到达192.168.1.1段怎么走,它会将c1发过来的数据包丢弃

C    192.168.2.0/24 is directly connected, FastEthernet0/0

C    192.168.3.0/24 is directly connected, FastEthernet0/1

解决c1 ping 192.168.2.2通行语法:在R2上加入静态路由命令

R2(config)#ip route  192.168.1.0 255.255.255.0 192.168.2.1

R2(config)#ip route 目标ip 目标掩码  中转IP

同理,c1 ping 192.168.3.1不通,需要在R1上加入静态路由

R1(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2

R1#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

Gateway of last resort is not set

C    192.168.1.0/24 is directly connected, FastEthernet0/0

C    192.168.2.0/24 is directly connected, FastEthernet0/1

S    192.168.3.0/24 [1/0] via 192.168.2.2(s静态)

此时c1 ping 192.168.3.0 ping通

现实中R1不可能会添加很多静态路由告诉路由器如何走通,此时需要用到默认路由

R3(config)#ip route 0.0.0.0 (任意网段)0.0.0.0(任意掩码) 192.168.3.1(R3上添加默认路由,不管到达哪个路由,都通过192.168.3.1行走)R1,R3可以用到默认路由,R2多个出口的路由器,不能用到默认路由,只能用到静态路由.

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

Gateway of last resort is 192.168.3.1 to network 0.0.0.0

C    192.168.3.0/24 is directly connected, FastEthernet0/0

S*  0.0.0.0/0 [1/0] via 192.168.3.1(s*表示默认路由)

R1#write保存R1配置文件

浮动路由拓扑图1

1.R1->R2 或者2.R1->R3->R2 默认走1,如果R1->R2线路出故障,走2

相关文章

  • 思科设备静态路由配置

    1.静态路由的工作原理及应用场景 2.默认路由的应用场景及配置方法 3.静态浮动路由的应用场景及配置方法 正常情况...

  • 思科静态路由配置实验

    安徽工业经济职业技术学院 - 31715 - 17#301 一、实验目的 掌握网络连通,实验不同网络之间的设备可以...

  • 锐捷实战系列(二十八) 交换机间的静态路由

    实训目的 三层设备静态路由配置。 实训背景 静态路由是指由用户或网络管理员手工配置的路由信息。当网络的拓扑结构或链...

  • 21天培训一个习惯之每天学习一小时----第4天

    第4天 2-1 IP路由原理、静态路由基本配置 路由器:3层设备 路由:是指导IP报文发送的路径信息,通过查路由表...

  • 锐捷实战系列(三十八) 静态路由

    实训目的 学习静态路由的原理。 学习静态路由的优缺点。 学习静态路由的配置使用。 实训背景 静态路由 静态路由是指...

  • CCNA-13、静态路由

    何时使用静态路由-路由器较少-唯一外连出口-星型拓扑 !静态路由它配置完是不会自己修改的, 配置静态路由 路由表中...

  • HCNA学习笔记(六) 路由协议基础

    路由信息产生 三种方式:设备自动发现,手工配置,通过动态路由协议生成设备自动发现的路由信息——直连路由;手工配置的...

  • HCNA-静态路由

    静态路由配置实例 1.配置思路 在路由器R1上配置一条静态路由,目的地/掩码是2.0.0.0/8,下一跳I...

  • 逸佳君:CCNA之静态路由实验

    静态路由实验 拓扑图: 实验要求: 1、只用静态路由,使得全网都能通信 2、配置RIPv2,使的静态路由成为备份路...

  • cisco Routing-RIP动态路由配置

    问题 在相对较小而且结构不变的网络中,静态路由是很好的解决方案,它配置简单而且不过多消耗设备资源(动态路由协议在运...

网友评论

      本文标题:思科设备静态路由配置

      本文链接:https://www.haomeiwen.com/subject/fsaybttx.html