玩转华为ENSP模拟器系列 | 配置IPv4静态路由示例

素材来源:华为路由器配置指南

一边学习一边整理试验笔记,并与大家分享,侵权即删,谢谢支持!

附上汇总贴:玩转华为ENSP模拟器系列 | 合集_COCOgsta的博客-CSDN博客_ensp实验大全


目标

利用IPv4静态路由,可以实现网络中任意两台设备之间的互通。

组网需求

路由器各接口及主机的IP地址和掩码如图1所示。要求采用静态路由,使图中任意两台主机之间都能互通。

配置思路

  • 首先配置各路由器各接口的IPv4地址,使网络互通。
  • 在路由器上配置到目的地址的IPv4静态路由及缺省路由。
  • 在各主机上配置IPv4缺省网关,使任意两台主机可以互通。

操作步骤

  1. 配置各接口的IP地址
  2. 配置静态路由

在DeviceA上配置IPv4缺省路由。

DeviceA:
ip route-static 0.0.0.0 0.0.0.0 1.1.4.2

在DeviceB上配置两条IPv4静态路由。

DeviceB:
ip route-static 1.1.1.0 255.255.255.0 1.1.4.1
ip route-static 1.1.3.0 255.255.255.0 1.1.4.6

在DeviceC上配置IPv4缺省路由。

DeviceC:
ip route-static 0.0.0.0 0.0.0.0 1.1.4.5
  1. 查看配置结果

显示DeviceA的IP路由表。

[~DeviceA]display ip routing-table
Route Flags: R - relay, D - download to fib, T - to vpn-instance, B - black hole route
------------------------------------------------------------------------------
Routing Table : _public_
         Destinations : 11       Routes : 11        
Destination/Mask    Proto   Pre  Cost        Flags NextHop         Interface
        0.0.0.0/0   Static  60   0             RD  1.1.4.2         Ethernet1/0/0
        1.1.1.0/24  Direct  0    0             D   1.1.1.1         Ethernet1/0/1
        1.1.1.1/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
      1.1.1.255/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/1
        1.1.4.0/30  Direct  0    0             D   1.1.4.1         Ethernet1/0/0
        1.1.4.1/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
        1.1.4.3/32  Direct  0    0             D   127.0.0.1       Ethernet1/0/0
      127.0.0.0/8   Direct  0    0             D   127.0.0.1       InLoopBack0
      127.0.0.1/32  Direct  0    0             D   127.0.0.1       InLoopBack0
127.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0
255.255.255.255/32  Direct  0    0             D   127.0.0.1       InLoopBack0
[~DeviceA]

使用ping命令验证连通性。

[~DeviceA]ping 1.1.3.1
  PING 1.1.3.1: 56  data bytes, press CTRL_C to break
    Reply from 1.1.3.1: bytes=56 Sequence=1 ttl=254 time=8 ms
    Reply from 1.1.3.1: bytes=56 Sequence=2 ttl=254 time=6 ms
    Reply from 1.1.3.1: bytes=56 Sequence=3 ttl=254 time=10 ms
    Reply from 1.1.3.1: bytes=56 Sequence=4 ttl=254 time=9 ms
    Reply from 1.1.3.1: bytes=56 Sequence=5 ttl=254 time=5 ms
  --- 1.1.3.1 ping statistics ---
    5 packet(s) transmitted
    5 packet(s) received
    0.00% packet loss
    round-trip min/avg/max = 5/7/10 ms
 
[~DeviceA]

使用tracert命令验证连通性。

[~DeviceA]tracert 1.1.3.1
 traceroute to 1.1.3.1(1.1.3.1), max hops: 30, packet length: 40, press CTRL_C t
o break
 1 1.1.4.2 10 ms  4 ms  5 ms 
 2 1.1.3.1 2 ms  2 ms  6 ms 
[~DeviceA]

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值