ensp静态路由配置实验
一、绘制网络拓扑图:
二、配置
pc配置
IP地址、掩码、网关一定要填好,填好后点击应用。
路由器配置:
R1
<Huawei>undo t t Info: Current terminal trapping is off. <Huawei>sys //进入配置视图 Enter system view, return user view with Ctrl+Z. [Huawei]sys R1 //为设备命名 [R1]int g0/0/1 //进入端口 [R1-GigabitEthernet0/0/1]ip address 192.1.1.254 24 //为端口配置IP地址和掩码 [R1-GigabitEthernet0/0/1]int g0/0/2 [R1-GigabitEthernet0/0/2]ip add 192.1.3.1 30 [R1-GigabitEthernet0/0/2]q [R1]ip router-s [R1]ip route-static 192.1.2.0 24 192.1.3.2 //配置静态路由
R2
<Huawei>undo t t Info: Current terminal trapping is off. <Huawei>sys Enter system view, return user view with Ctrl+Z. [Huawei]sys R2 [R2]int g0/0/1 [R2-GigabitEthernet0/0/1]ip add 192.1.2.254 24 [R2-GigabitEthernet0/0/1]int g0/0/2 [R2-GigabitEthernet0/0/2]ip add 192.1.3.2 30 [R2-GigabitEthernet0/0/2]q [R2]ip route-static 192.1.1.0 24 192.1.3.1
关键代码:ip route-static 目的IP 目的IP的掩码 下一跳IP
三、测试连通性
打开pc的命令行-去ping别的pc机能通则代表实验成功