您的位置:首页 > 其它

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

2018-01-29 20:11 1296 查看
设置环境
PC1 192.168.1.1 255.255.255.0
网关 192.168.1.254
PC2 192.168.31 255.255.255.0
网关 192.168.3254
连线图如下



全部开机启动
配置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 (查看详细配置)



验证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命令



Ping通,验结束。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  华为 路由器 PC机