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

  • 相关阅读:
    利刃 MVVMLight 1:MVVMLight介绍以及在项目中的使用
    HTML5项目笔记10:使用HTML5 IndexDB设计离线数据库
    MySQL数据库安装
    安装维护手册
    XXX银行项目部署
    使用Excel批量给数据添加单引号和逗号
    sublime3 快速创建html模板
    Wyn Enterprise 报表查询面板三种实现方法汇总
    仪表板中选项卡外观样式详细设置讲解
    Wyn Enterprise 自助式分析(1)门户中的个人偏好设置
  • 原文地址:https://www.cnblogs.com/a1972/p/11576269.html
Copyright © 2011-2022 走看看