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

  • 相关阅读:
    一、Python概念知识点汇总
    在ubuntu永久添加alias
    字符串转化为数字 不用sscanf
    python class类
    《Effective C++》笔记
    问到面向对象该如何回答
    数字和字符串互相转换
    python input print 输入输出
    《c专家编程》笔记
    判断是否是回文数
  • 原文地址:https://www.cnblogs.com/a1972/p/11576269.html
Copyright © 2011-2022 走看看