• TCP/IP_第八章_静态路由_实验案例二


    实验案例二:配置静态路由实现路由选路

    1、实验环境

            如图8.11所示,三台路由器R1, R2,R3两两互连。R2上配置了Loopback地址192.168.20 .1/24,模拟192.168.20.0/24网段;R3上配置了两个Loopback地址192.168.10.1/24、192.168 .30.1/24.分别用来模拟192.168.10.0/24和192.168.30.0/24网段。

    2、需求描述

            需要实现当192.168.20.0/24访问192.168.30.0/24时,数据从R2到R3,而当192.168.20.0/24访问192.168.10.0/24时,数据从R2经过R1再到R3,返回的路由都从R3到R2,

    3、推荐步骤

    步骤1:在R2上配置到192.168.30.0/24的静态路由。

    步骤2:在R2上配置到192.168.10.0/24的静态路由,在R1上也应该配置到192.168.10.0/24的静态路由。

    步骤3:在 R3上配置回程的静态路由。

    4、实验步骤

    (1)路由器R1上的基础配置

    1. R1(config)#interface gigabitEthernet 0/3/0
    2. R1(config-if)#ip address 192.168.1.1 255.255.255.0
    3. R1(config-if)#no shutdown
    4. R1(config-if)#exit
    5. R1(config)#interface gigabitEthernet 0/2/0
    6. R1(config-if)#ip address 192.168.2.1 255.255.255.0
    7. R1(config-if)#no shutdown
    8. R1(config-if)#exit

    (2)路由器R2上的基础配置

    1. R2(config)#interface gigabitEthernet 0/3/0
    2. R2(config-if)#ip address 192.168.1.2 255.255.255.0
    3. R2(config-if)#no shutdown
    4. R2(config-if)#exit
    5. R2(config)#interface gigabitEthernet 0/2/0
    6. R2(config-if)#ip address 192.168.3.2 255.255.255.0
    7. R2(config-if)#no shutdown
    8. R2(config-if)#exit
    9. R2(config)#interface gigabitEthernet 0/0
    10. R2(config-if)#ip address 192.168.20.254 255.255.255.0
    11. R2(config-if)#no shutdown
    12. R2(config-if)#exit

    (3)路由器R3上的基础配置

    1. R3(config)#interface gigabitEthernet 0/3/0
    2. R3(config-if)#ip address 192.168.2.3 255.255.255.0
    3. R3(config-if)#no shutdown
    4. R3(config-if)#exit
    5. R3(config)#interface gigabitEthernet 0/2/0
    6. R3(config-if)#ip address 192.168.3.3 255.255.255.0
    7. R3(config-if)#no shutdown
    8. R3(config-if)#exit
    9. R3(config)#interface gigabitEthernet 0/0
    10. R3(config-if)#ip address 192.168.10.254 255.255.255.0
    11. R3(config-if)#no shutdown
    12. R3(config-if)#exit
    13. R3(config)#interface gigabitEthernet 0/1
    14. R3(config-if)#ip address 192.168.30.254 255.255.255.0
    15. R3(config-if)#no shutdown
    16. R3(config-if)#exit

    (4)各路由器上配置静态路由

    1. ##R1上的静态路由配置
    2. R1(config)#ip route 192.168.20.0 255.255.255.0 192.168.1.2
    3. R1(config)#ip route 192.168.10.0 255.255.255.0 192.168.2.3
    4. ##R2上的静态路由配置
    5. R2(config)#ip route 192.168.10.0 255.255.255.0 192.168.1.1
    6. R2(config)#ip route 192.168.30.0 255.255.255.0 192.168.3.3
    7. ##R3上的静态路由配置
    8. R3(config)#ip route 192.168.20.0 255.255.255.0 192.168.3.2

    5、实验调试

    (1)查看各路由器上的静态路由条目

    1. ##R1上的静态路由条目
    2. R1#show ip route static
    3. S 192.168.10.0/24 [1/0] via 192.168.2.3
    4. S 192.168.20.0/24 [1/0] via 192.168.1.2
    5. ##R2上的静态路由条目
    6. R2#show ip route static
    7. S 192.168.10.0/24 [1/0] via 192.168.1.1
    8. S 192.168.30.0/24 [1/0] via 192.168.3.3
    9. ##R3上的静态路由条目
    10. R3#show ip route static
    11. S 192.168.20.0/24 [1/0] via 192.168.3.2

    (2)ping测试结果

    观察PC1到PC2的流量方向

    pc1topc2

    观察PC1到PC3的流量方向

    pc1topc3

    (3)分析结果

    1. 路由器根据路由表能够将数据包转发到正确的目的地。
    2. 路由器在转发过程中选择最佳路径。
    3. 静态路由需要管理员手工配置。
    4. 静态路由是单向的。
  • 相关阅读:
    用了Keras来构建一个卷积神经网络对MNIST数据集进行分类
    276_Python_桌面的一个TXT文档里的内容,插入到Word文档的指定位置
    Redis缓存设计与性能优化【缓存穿透、缓存击穿、缓存雪崩】
    Python generator高级方法应用解析
    Shell 函数详解(函数定义、函数调用)
    两台交换机端口不同的强制双工速率配置的端口协商情况
    SpringBoot:使用jpa实现对Apache Geode的基本操作
    消息推送平台有没有保证数据不丢?
    基于SSH的进存销管理系统
    error: use of undeclared identifier ‘MainWindow
  • 原文地址:https://blog.csdn.net/m0_38096339/article/details/137904988