zoukankan      html  css  js  c++  java
  • Static root and default route

    静态路由配置1

     

    设置PCip,网关,开启接口,设置静态路由(目标网段+子网掩码+下一跳地址)

    Router1为例

    Router>

    Router>enable

    Router#configure terminal

    Router(config)#int f0/0

    Router(config-if)#ip address 192.168.1.3 255.255.255.0

    Router(config-if)#no shutdown

    Router(config-if)#exit

    Router(config)#int f0/1

    Router(config-if)#ip address 192.168.2.1 255.255.255.0      (设置两个接口的ip地址)

    Router(config-if)#no shutdown

    Router(config-if)#exit

    Router(config)#ip route 192.168.3.0 255.255.255.0 192.168.2.2

    Router(config)#ip route 192.168.4.0 255.255.255.0 192.168.2.2(下一跳到达3.04.0网段)

    Router(config)#

    其他两个路由器同理

    此拓扑图中,将三个路由器全部设置为静态路由或者两边两个设置为默认路由,中间位置设置为静态路由。

    设置默认路由方法

    Router(config)#ip route0.0.0.0 0.0.0.0 下一跳地址

    Router#show ip route

     

    静态路由配置2

     

    设置PCip,网关,设置routerip并开启其接口,设置静态路由(目标网段+子网掩码+下一跳地址)以及默认路由(0.0.0.0 0.0.0.0 下一跳地址)

    14router 设置为default route   (默认路由)

    23router 设置为 static route    (静态路由)

    1router设置过程

    Router>

    Router>enable

    Router#configure terminal

    Router(config)#int f0/0

    Router(config-if)#ip address 192.168.1.3 255.255.255.0

    Router(config-if)#no shutdown

    Router(config-if)#

    %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

    Router(config-if)#exit

    Router(config)#int f0/1

    Router(config-if)#ip address 192.168.2.1 255.255.255.0

    Router(config-if)#no shutdown

    Router(config-if)#

    %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

    Router(config-if)#exit

    Router(config)#ip route 0.0.0.0.0 0.0.0.0 192.168.2.2

    Router(config)#

    4router类比1

    3router设置如下

    Router>en

    Router#configure  terminal

    Router(config)#int f0/0

    Router(config-if)#ip address 192.168.3.2 255.255.255.0

    Router(config-if)#no shutdown

    Router(config-if)#

    %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up

    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up

    Router(config-if)#exit

    Router(config)#int f0/1

    Router(config-if)#ip address 192.168.4.1 255.255.255.0

    Router(config-if)#no shutdown

    Router(config-if)#

    %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up

    %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up

    Router(config-if)#exit

    Router(config)#ip route 192.168.5.0 255.255.255.0 192.168.4.2

    Router(config)#ip route 192.168.2.0 255.255.255.0 192.168.3.1

    Router(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1

    Router(config)#exit

    Router#

    Router#show ip route

    Gateway of last resort is not set

    S    192.168.1.0/24 [1/0] via 192.168.3.1

    S    192.168.2.0/24 [1/0] via 192.168.3.1

    C    192.168.3.0/24 is directly connected, FastEthernet0/0

    C    192.168.4.0/24 is directly connected, FastEthernet0/1  (直连)

    S    192.168.5.0/24 [1/0] via 192.168.4.2   (静态)

    2router设置类比3

  • 相关阅读:
    HDOJ2066 一个人的旅行 floyd
    手动添加数据源时DataGridViewComboBoxCell值出问题解决方法
    可伸缩的Form窗体!
    SharpMap项目Web控件学习!
    MVC和MVP的初步理解
    ArcEngine编辑功能(五)
    胡言乱语:实体具有继承关系的空间数据库设计方法?
    WinForm单例窗体的实现
    4. 模板模式和建造者模式
    Oracle笔记(0):在Win2008系统上安装Oracle11g实践
  • 原文地址:https://www.cnblogs.com/a1972/p/11576269.html
Copyright © 2011-2022 走看看