华为路由器AR2220简单的静态路由配置

网络拓扑图

配置静态路由命令

主要命令

interface G0/0/1 //进入端口G0/0/1
ip add 10.1.1.1 24 //配置目前端口的ip地址为 10.1.1.1.1子网掩24位
ip route-staic 30.1.1.0 24 20.1.1.2 //添加静态IP条目 :目的ip30.1.1.0 掩码 24 下一跳 :20.1.1.2

R1的配置

在这里插入图片描述

The device is running!

<Huawei>sys //进入系统模式
Enter system view, return user view with Ctrl+Z.

[Huawei]interface G0/0/0 //进入G0/0/1端口
[Huawei-GigabitEthernet0/0/0]ip add 20.1.1.1 24 //为该端口设置IP地址 20.1.1.1
Jun 16 2020 21:14:06-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
 //设置成功
[Huawei-GigabitEthernet0/0/0]q //退出当前端口
[Huawei]interface G0/0/1 // 进入G0/0/1端口
[Huawei-GigabitEthernet0/0/1]ip add 10.1.1.254 24 //设置IP
Jun 16 2020 21:14:41-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
 //设置成功
[[Huawei-GigabitEthernet0/0/1]q //退出

[Huawei]ip route-static 30.1.1.0 24 20.1.1.2
//添加静态路由条目 目的ip: 30.1.1.0 (0)表示广播地址 掩码 24 位 下一跳 20.1.1.2 

R2的配置

在这里插入图片描述

The device is running!

<Huawei>
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]interface G0/0/0
[Huawei-GigabitEthernet0/0/0]ip add 20.1.1.2 24
Jun 16 2020 21:15:30-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[0]:The line protocol
 IP on the interface GigabitEthernet0/0/0 has entered the UP state. 
[Huawei-GigabitEthernet0/0/0]q
[Huawei]interface G0/0/1
[Huawei-GigabitEthernet0/0/1]ip add 30.1.1.254 24
Jun 16 2020 21:16:00-08:00 Huawei %%01IFNET/4/LINK_STATE(l)[1]:The line protocol
 IP on the interface GigabitEthernet0/0/1 has entered the UP state. 
[Huawei-GigabitEthernet0/0/1]
[Huawei]ip route-static 10.1.1.0 24 20.1.1.1

测试PC的连通Ping

用PC1 ping PC2 成功
OK!

PC>ping 30.1.1.1

Ping 30.1.1.1: 32 data bytes, Press Ctrl_C to break
From 30.1.1.1: bytes=32 seq=1 ttl=126 time=15 ms
From 30.1.1.1: bytes=32 seq=2 ttl=126 time=15 ms
From 30.1.1.1: bytes=32 seq=3 ttl=126 time=15 ms
From 30.1.1.1: bytes=32 seq=4 ttl=126 time=15 ms
From 30.1.1.1: bytes=32 seq=5 ttl=126 time=15 ms

--- 30.1.1.1 ping statistics ---
  5 packet(s) transmitted
  5 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 15/15/15 ms

PC>

PC2 ping PC1 OK
哈拉少~ ~

PC>ping 10.1.1.1

Ping 10.1.1.1: 32 data bytes, Press Ctrl_C to break
Request timeout!
From 10.1.1.1: bytes=32 seq=2 ttl=126 time=15 ms
From 10.1.1.1: bytes=32 seq=3 ttl=126 time=31 ms
From 10.1.1.1: bytes=32 seq=4 ttl=126 time=16 ms
From 10.1.1.1: bytes=32 seq=5 ttl=126 time=16 ms

--- 10.1.1.1 ping statistics ---
  5 packet(s) transmitted
  4 packet(s) received
  20.00% packet loss
  round-trip min/avg/max = 0/19/31 ms

PC>
  • 3
    点赞
  • 22
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值