0
  • 聊天消息
  • 系统消息
  • 评论与回复
登录后你可以
  • 下载海量资料
  • 学习在线课程
  • 观看技术视频
  • 写文章/发帖/加入社区
创作中心

完善资料让更多小伙伴认识你,还能领取20积分哦,立即完善>

3天内不再提示

Cisco配置静态路由

马哥Linux运维 来源:稀土掘金技术社区 2023-12-03 09:43 次阅读

实验拓扑

a2dc4bc2-90f6-11ee-939d-92fbcf53809c.jpg

配置R1


Router(config)




R1(config)
R1(config-if)
R1(config-if)




R1(config-if)
R1(config-if)
R1(config-if)




R1(config)
R1(config)

查看接口ip


R1
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.12.1    YES manual up                    up      
Ethernet0/1                192.168.1.254   YES manual up                    up      
Ethernet0/2                unassigned      YES unset  administratively down down    
Ethernet0/3                unassigned      YES unset  administratively down down    
Serial1/0                  unassigned      YES unset  administratively down down    
Serial1/1                  unassigned      YES unset  administratively down down    
Serial1/2                  unassigned      YES unset  administratively down down    
Serial1/3                  unassigned      YES unset  administratively down down 

查看R1路由表


R1
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


      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, Ethernet0/1
L        192.168.1.254/32 is directly connected, Ethernet0/1
S     192.168.3.0/24 [1/0] via 192.168.12.2
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, Ethernet0/0
L        192.168.12.1/32 is directly connected, Ethernet0/0
S     192.168.23.0/24 [1/0] via 192.168.12.2

配置R2


Router>enable
Router
Router(config)




R2(config)
R2(config-if)
R2(config-if)




R2(config-if)
R2(config-if)
R2(config-if)




R2(config)
R2(config)

查看接口ip


R2
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.12.2    YES manual up                    up      
Ethernet0/1                192.168.23.2    YES manual up                    up      
Ethernet0/2                unassigned      YES unset  administratively down down    
Ethernet0/3                unassigned      YES unset  administratively down down    
Serial1/0                  unassigned      YES unset  administratively down down    
Serial1/1                  unassigned      YES unset  administratively down down    
Serial1/2                  unassigned      YES unset  administratively down down    
Serial1/3                  unassigned      YES unset  administratively down down

查看路由


R2
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


S     192.168.1.0/24 [1/0] via 192.168.12.1
S     192.168.3.0/24 [1/0] via 192.168.23.3
      192.168.12.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.12.0/24 is directly connected, Ethernet0/0
L        192.168.12.2/32 is directly connected, Ethernet0/0
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, Ethernet0/1
L        192.168.23.2/32 is directly connected, Ethernet0/1

配置R3


Router>enable 
Router
Router(config)
R3(config)


R3(config)
R3(config-if)
R3(config-if)


R3(config-if)
R3(config-if)
R3(config-if)


R3(config)
R3(config)

查看接口ip


R3
Interface                  IP-Address      OK? Method Status                Protocol
Ethernet0/0                192.168.23.3    YES manual up                    up      
Ethernet0/1                192.168.3.254   YES manual up                    up      
Ethernet0/2                unassigned      YES unset  administratively down down    
Ethernet0/3                unassigned      YES unset  administratively down down    
Serial1/0                  unassigned      YES unset  administratively down down    
Serial1/1                  unassigned      YES unset  administratively down down    
Serial1/2                  unassigned      YES unset  administratively down down    
Serial1/3                  unassigned      YES unset  administratively down down   

查看路由


R3
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


S     192.168.1.0/24 [1/0] via 192.168.23.2
      192.168.3.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.3.0/24 is directly connected, Ethernet0/1
L        192.168.3.254/32 is directly connected, Ethernet0/1
S     192.168.12.0/24 [1/0] via 192.168.23.2
      192.168.23.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.23.0/24 is directly connected, Ethernet0/0
L        192.168.23.3/32 is directly connected, Ethernet0/0

配置vpc4


VPCS> ip 192.168.1.2/24 192.168.1.254
Checking for duplicate address...
VPCS : 192.168.1.2 255.255.255.0 gateway 192.168.1.254

配置vpc5


VPCS> ip 192.168.3.2/24 192.168.3.254
Checking for duplicate address...
VPCS : 192.168.3.2 255.255.255.0 gateway 192.168.3.254

在vpc4上ping vpc5测试连通性


VPCS> ping 192.168.3.2


84 bytes from 192.168.3.2 icmp_seq=1 ttl=61 time=0.958 ms
84 bytes from 192.168.3.2 icmp_seq=2 ttl=61 time=0.785 ms
84 bytes from 192.168.3.2 icmp_seq=3 ttl=61 time=1.050 ms
84 bytes from 192.168.3.2 icmp_seq=4 ttl=61 time=0.823 ms
84 bytes from 192.168.3.2 icmp_seq=5 ttl=61 time=0.827 ms

审核编辑:汤梓红

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
  • 接口
    +关注

    关注

    33

    文章

    7648

    浏览量

    148533
  • CISCO
    +关注

    关注

    1

    文章

    64

    浏览量

    24568
  • 静态路由
    +关注

    关注

    0

    文章

    17

    浏览量

    8543

原文标题:Cisco配置静态路由

文章出处:【微信号:magedu-Linux,微信公众号:马哥Linux运维】欢迎添加关注!文章转载请注明出处。

收藏 人收藏

    评论

    相关推荐

    Cisco路由器网络设计

    Cisco路由器网络设计相关知识,拓展网络知识。
    发表于 06-04 19:42 29次下载

    CISCO路由配置实例

    Cisco 路由器的基本配置百余例目录1.用户通过DDN专线接入ISP 2.远程用户拨号连入局域网 3.远程用户间对拨 4.Cisco 
    发表于 08-31 09:46 46次下载

    Cisco路由安全性分析和改进

    路由器安全在网络安全领域占有非常重要的地位,针对互联网中使用最为广泛的Cisco路由器,从3个方面出发分别说明了Cisco路由器所面临的各种
    发表于 11-24 18:41 15次下载

    静态路由协议配置

    实验十、静态路由协议配置 一、实验原理1.1 路由协议路由器依据路由表进行转发。
    发表于 09-24 13:48 4571次阅读
    <b class='flag-5'>静态</b><b class='flag-5'>路由</b>协议<b class='flag-5'>配置</b>

    配置静态路由

    配置静态路由 用户可以在全局配置模式下通过命令 ip route
    发表于 06-09 23:51 762次阅读
    <b class='flag-5'>配置</b><b class='flag-5'>静态</b><b class='flag-5'>路由</b>

    静态路由配置举例

    静态路由配置举例 在这个例子中使用 IP ROUTE 命令来配置静态路由:ip route
    发表于 06-09 23:52 1061次阅读
    <b class='flag-5'>静态</b><b class='flag-5'>路由</b><b class='flag-5'>配置</b>举例

    CISCO系列路由器密码恢复汇总

    CISCO系列路由器密码恢复汇总   密码恢复原理(1)Cisco路由器保存了几种不同的配置参数,并存放在不
    发表于 01-13 13:03 837次阅读

    CISCO路由器初始配置手册

    CISCO路由器初始配置手册 很多初学路由器知识的网友对路由器的初始配置可能感到很陌生,本人在
    发表于 04-01 11:49 781次阅读

    CISCO路由器之广域网协议设置

    CISCO路由器之广域网协议设置 一、HDLC HDLC是CISCO路由器使用的缺省协议,一台新路由器在未指定封装协议时默认使用H
    发表于 04-01 13:42 3289次阅读

    CISCO与华为3COM路由器的比较分析

    剖析CISCO与华为3COM路由器的区别,熟练掌握下面涉及到的CISCO与华为3COM路由器知识,很多方法都会使你豁然开朗的。华为路由器与同
    发表于 02-26 10:22 1122次阅读

    Cisco路由器流量采集软件的研制_张欣

    Cisco路由器流量采集软件的研制_张欣
    发表于 03-19 11:26 0次下载

    怎么样配置Cisco单臂路由?关键步骤解析

    单臂路由,即在路由器上设置多个逻辑子接口,每个子接口对应一个vlan。在每个子接口的数据在物理链路上传递都要标记封装。Cisco设备支持ISL和802.1q(dot1Q)协议。华为只支持802.1q。
    发表于 12-05 13:38 1540次阅读
    怎么样<b class='flag-5'>配置</b><b class='flag-5'>Cisco</b>单臂<b class='flag-5'>路由</b>?关键步骤解析

    思科路由配置基础_7个方面详解cisco路由配置

    大家一定对Cisco路由器并不陌生,作为第一个入行的国际化企业而言,它的产品众所周知,但也正因为如此让大家对于一些有关它的配置有所困惑,本文主要介绍的是思科路由
    发表于 05-14 09:32 1.6w次阅读

    详解交换机与路由器的配置,如何配置静态路由

    一种路由的方式,路由项由手动配置,而非动态决定。与动态路由不同,静态路由是固定的,不会改变,即使
    的头像 发表于 01-03 10:19 2353次阅读

    静态路由是什么?静态路由如何配置

    静态路由是一种路由的方式,路由项由手动配置,而非动态决定。与动态路由不同,
    的头像 发表于 10-07 10:48 6814次阅读
    <b class='flag-5'>静态</b><b class='flag-5'>路由</b>是什么?<b class='flag-5'>静态</b><b class='flag-5'>路由</b>如何<b class='flag-5'>配置</b>?