华为初命令实践!两个PC机,两个路由器,实现PC机ping通以及静态路由配置。...

设置环境
PC1 192.168.1.1 255.255.255.0
网关 192.168.1.254
PC2 192.168.31 255.255.255.0
网关 192.168.3254
连线图如下
华为初命令实践!两个PC机,两个路由器,实现PC机ping通以及静态路由配置。
全部开机启动
配置AR5
<Huawei>system-view (进入系统视图)
Enter system view, return user view with Ctrl+Z.
[Huawei]undo info enable (关闭信息乱码,可以打可以不打)
Info: Information center is disabled.
[Huawei]sysname AR5(更改设备名)
[AR5]interface Ethernet 0/0/0(进入0/0/0接口)
[AR5-Ethernet0/0/0]ip address 192.168.1.254 255.255.255.0(配置接口IP)
[AR5-Ethernet0/0/0]undo shutdown (开启接口)
Info: Interface Ethernet0/0/0 is not shutdown.
[AR5-Ethernet0/0/0]interface Ethernet 0/0/1
[AR5-Ethernet0/0/1]ip address 192.168.2.1 255.255.255.0
[AR5-Ethernet0/0/1]undo shutdown
Info: Interface Ethernet0/0/1 is not shutdown.
[AR5-Ethernet0/0/1]quit(退出到上一层)
[AR5]quit
<AR5>save (保存)
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Info: Please input the file name ( .cfg, .zip ) [vrpcfg.zip]:
Now saving the current configuration to the slot 17.
Save the configuration successfully.

配置AR7
同理R5,只是IP不同,见图
<Huawei>display current-configuration (查看详细配置)
华为初命令实践!两个PC机,两个路由器,实现PC机ping通以及静态路由配置。

验证ping操作
华为初命令实践!两个PC机,两个路由器,实现PC机ping通以及静态路由配置。

不通因分析
1、各个接口IP配置完成,PC机设置已完成。
2、检查路由表,发现未配置静态路由。

静态路由
定义:需管理员手动配置,且数据包是有去有回,故每个路由器都需拥有整条路上的网段。
配置:ip route-static 去往目标网段 子网掩码 下一跳(永远是直接相连的路由器的端口IP地址)
本实验例子
[AR5]ip route-static 192.168.3.0 255.255.255.0 192.168.2.2
[Huawei]ip route-static 192.168.1.0 255.255.255.0 192.168.2.1

测试ping命令
华为初命令实践!两个PC机,两个路由器,实现PC机ping通以及静态路由配置。
Ping通,验结束。

转载于:https://blog.51cto.com/13585611/2066548

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值