实验室环境-跨网段静态路由配置

要求:1.使用静态路由使PC1 访问 PC2
          2.使用默认路由使PC1 访问 PC2
(接口ip已配置好)

1.使用静态路由使PC1 访问 PC2
配置思路
R1要配置去往10.23.23.0网段和10.10.20.0网段的静态路由
R2要配置到10.10.10.0 10.10.20.0 两个网段的静态路由
R3要配置去往10.12.12.0网段和10.10.10.0网段的静态路由

R1:
ip route 10.10.20.0 255.255.255.0 10.12.12.2
ip route 10.23.23.0 255.255.255.252 10.12.12.2

show ip route
       10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
S      10.23.23.0/30 [1/0] via 10.12.12.2
C      10.12.12.0/30 is directly connected, FastEthernet0/1
C      10.10.10.0/24 is directly connected, FastEthernet0/0
S      10.10.20.0/24 [1/0] via 10.12.12.2
R2:
ip route 10.10.10.0 255.255.255.0 10.12.12.1
ip route 10.10.20.0 255.255.255.0 10.23.23.2


    10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C      10.23.23.0/30 is directly connected, FastEthernet0/1
C      10.12.12.0/30 is directly connected, FastEthernet0/0
S      10.10.10.0/24 [1/0] via 10.12.12.1
S      10.10.20.0/24 [1/0] via 10.23.23.2
R3:
ip route 10.10.10.0 255.255.255.0 10.23.23.1
ip route 10.12.12.0 255.255.255.252 10.23.23.1

show ip route

    10.0.0.0/8 is variably subnetted, 4 subnets, 2 masks
C      10.23.23.0/30 is directly connected, FastEthernet0/0
S      10.12.12.0/30 [1/0] via 10.23.23.1
S      10.10.10.0/24 [1/0] via 10.23.23.1
C      10.10.20.0/24 is directly connected, FastEthernet0/1

PC1#ping 10.12.12.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.12.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 20/21/24 ms

2.使用默认路由使PC1 访问 PC2 (仅限在实验室环境,仅作一种实验参考)
配置思路
将三台路由器分别开启通往各个网段的端口的默认路由
R1:
ip route 0.0.0.0 0.0.0.0 FastEthernet0/1 10.12.12.2


show ip route
         10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C      10.12.12.0/30 is directly connected, FastEthernet0/1
C      10.10.10.0/24 is directly connected, FastEthernet0/0
S*  0.0.0.0/0 [1/0] via 10.12.12.2, FastEthernet0/1
R2:
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0 10.12.12.1
ip route 0.0.0.0 0.0.0.0 FastEthernet0/1 10.23.23.2

show ip route 
    10.0.0.0/30 is subnetted, 2 subnets
C      10.23.23.0 is directly connected, FastEthernet0/1
C      10.12.12.0 is directly connected, FastEthernet0/0
S*  0.0.0.0/0 [1/0] via 10.23.23.2, FastEthernet0/1
              [1/0] via 10.12.12.1, FastEthernet0/0

R3:
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0 10.23.23.1
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0 10.12.12.2

show ip route 
      10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C      10.23.23.0/30 is directly connected, FastEthernet0/0
C      10.10.20.0/24 is directly connected, FastEthernet0/1
S*  0.0.0.0/0 [1/0] via 10.23.23.1, FastEthernet0/0

PC1#ping 10.10.10.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.10.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/1 ms

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
网络中,路由器是实现不同子网间通信的核心设备之一。而静态路由是指网络管理员手动配置路由表达到达目的地的路径,与动态路由相比,静态路由的优点是简单可靠,适用于小型网络。 下面介绍一下静态路由配置实验的步骤: 1. 确定网络拓扑结构 首先,需要确定网络拓扑结构,即网络中所有设备之间的连接方式,如何划分子网等。本实验中,我们假定网络拓扑结构如下图所示: ``` +------+ +------+ | | | | | R1 +-------------+ R2 | | | | | +------+ +------+ | | | | +------+ +------+ | | | | | PC1 | | PC2 | | | | | +------+ +------+ ``` 其中,R1和R2分别是两台路由器,PC1和PC2分别是两台主机。 2. 配置IP地址 在确认了网络拓扑结构后,需要为网络中的每个设备配置IP地址。假定IP地址分配如下: - R1: 192.168.1.1/24 - R2: 192.168.2.1/24 - PC1: 192.168.1.2/24 - PC2: 192.168.2.2/24 在实际配置中,可以通过CLI命令或者Web界面等方式进行IP地址配置。 3. 配置路由 在确认了IP地址后,需要配置路由表。假定网络中需要实现PC1能够访问PC2的功能。 在R1上,需要将数据包转发给R2,因此需要配置R1的路由表,将目的地址为192.168.2.0/24的数据包转发给R2。配置命令如下: ``` R1(config)# ip route 192.168.2.0 255.255.255.0 192.168.1.1 ``` 其中,ip route命令表示添加静态路由,192.168.2.0表示目的网段,255.255.255.0表示子网掩码,192.168.1.1表示下一跳路由器的IP地址。 同理,在R2上,需要将数据包转发给PC2,因此需要配置R2的路由表,将目的地址为192.168.1.0/24的数据包转发给R1。配置命令如下: ``` R2(config)# ip route 192.168.1.0 255.255.255.0 192.168.2.1 ``` 4. 测试连通性 完成了路由配置后,需要测试连通性。可以使用ping命令来检查PC1和PC2之间是否能够互相通信。在PC1上执行以下命令: ``` ping 192.168.2.2 ``` 如果能够ping通,则说明配置成功。 以上就是静态路由配置实验的步骤。在实际配置中,需要注意IP地址分配和路由配置的正确性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值