【网络配置】跨网段静态路由配置

要求: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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值