华为ensp静态路由配置 |
您所在的位置:网站首页 › ensp静态路由配置命令代码 › 华为ensp静态路由配置 |
**静态路由# 学习目标: 了解静态路由原理和弊端 掌握配置静态路由的命令 成功配置静态路由 对静态路由排错的命令 学习内容:静态路由 1、 规划拓扑图 2、 使用华为ensp模拟器配置静态路由 3、 掌握静态路由配置命令 4、排错命令 学习时间:提示:2021/12/2 学习内容: 静态路由:是指用户或网络管理员手工配置的路由信息。当网络拓扑结构或链路状态发生改变时,需要网络管理员手工配置静态路由信息。 静态路由弊端:相比于动态路由协议,静态路由并不适用于大型网络,因为大型网络在一旦发生变动管理员需要花费大量的时间进行配置,同时配置如有错误排错也是一个很漫长痛苦的事情 何时适合静态路由稳定小型局域网 基于华为ensp模拟器配置静态路由命令详解:
sys #进入系统视图 [Huawei]sysname R1 #给路由器重新命名为R1 [R1]int g #选择接口,先配置g0/0/1口 [R1]int GigabitEthernet 0/0/1 [R1-GigabitEthernet0/0/1]ip address 192.168.10.254 24 #分配IP地址 Dec 2 2021 18:56:28-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [R1-GigabitEthernet0/0/1]q #退出该接口 [R1]int g [R1]int GigabitEthernet 0/0/0 #进入g0/0/0口配置 [R1-GigabitEthernet0/0/0]ip add 10.0.12.1 24 #分配IP地址 Dec 2 2021 18:56:54-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R1-GigabitEthernet0/0/0]q [R1]ip route-static 192.168.20.0 24 10.0.12.2 #在系统模式下配置静态路由,此实验是需要使pc1和pc2互相通信,那么目标主机便是IP段为192.168.20.0/24的主机 从路由器R1出去的的第一跳就为路由器R2的G0/0/0口 R2sys Enter system view, return user view with Ctrl+Z. [Huawei]sysname R2 [R2]int g0/0/0 [R2-GigabitEthernet0/0/0]ip add 10.0.12.2 24 Dec 2 2021 18:57:33-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R2-GigabitEthernet0/0/0]q [R2]int g0/0/1 [R2-GigabitEthernet0/0/1]ip address 10.0.23.2 24 Dec 2 2021 18:57:56-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [R2-GigabitEthernet0/0/1]q [R2]ip route-static 192.168.10.0 24 10.0.12.1 [R2]ip route-static 192.168.20.0 24 10.0.23.3 #静态路由通信是双向的(request和reply),所以配置时也需要两头都配置,pc1通信向pc2的方向时192.168.20.0/24 R2需要通过的路径只剩下R3的g0/0/1口地址为10.0.23.3 #pc2回应pc1的目标为192.168.10.0/24路径有R1的g/0/0/0口10.0.12.1 R3system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R3 [R3]int g0/0/1 [R3-GigabitEthernet0/0/1]ip add 10.0.23.3 24 Dec 2 2021 18:58:34-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [R3-GigabitEthernet0/0/1]q [R3]int g0/0/0 [R3-GigabitEthernet0/0/0]ip add 192.168.20.254 24 Dec 2 2021 18:58:53-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R3-GigabitEthernet0/0/0]q [R3]ip route-static 192.168.10.0 24 10.0.23.2 #PC2和PC1通信目标主机时192.168.10.0网段的主机,而R3需要靠路由器R2的g0/0/1口找到目标主机 到此静态路由配置完毕,主机之间互ping便可知道配置是否成功了system-view [Huawei]sysname R1 [R1]int GigabitEthernet 0/0/1 [R1-GigabitEthernet0/0/1]ip address 10.1.1.254 24 Dec 2 2021 20:10:32-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [R1-GigabitEthernet0/0/1]q [R1]int GigabitEthernet 0/0/0 [R1-GigabitEthernet0/0/0]ip address 10.1.123.1 24 Dec 2 2021 20:10:54-08:00 R1 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R1]ip route-static 10.3.3.0 24 10.1.123.3 [R1]ip route-static 10.2.2.0 24 10.1.123.2 #需要和pc2、pc3通信分清目标主机IP地址段和需要经过的路段是多少 R2配置命令system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R2 [R2]interface GigabitEthernet 0/0/2 [R2-GigabitEthernet0/0/2]ip address 10.1.123.2 24 Dec 2 2021 20:11:54-08:00 R2 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/2 has entered the UP state. [R2-GigabitEthernet0/0/2]q [R2]int GigabitEthernet 0/0/1 [R2-GigabitEthernet0/0/1]ip address 10.2.2.254 24 Dec 2 2021 20:12:13-08:00 R2 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [R2-GigabitEthernet0/0/1]q [R2]ip route-static 10.1.1.0 24 10.1.123.1 #pc2进行reply的目标主机段和需要经过的路段 R3配置命令system-view Enter system view, return user view with Ctrl+Z. [Huawei]sysname R3 [R3]int g [R3]int GigabitEthernet 0/0/1 [R3-GigabitEthernet0/0/1]ip address 10.3.3.254 24 Dec 2 2021 20:12:50-08:00 R3 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP on the interface GigabitEthernet0/0/1 has entered the UP state. [R3-GigabitEthernet0/0/1]q [R3]interface GigabitEthernet 0/0/0 [R3-GigabitEthernet0/0/0]ip address 10.1.123.3 24 Dec 2 2021 20:13:14-08:00 R3 %%01IFNET/4/LINK_STATE(l)[1]:The line protocol IP on the interface GigabitEthernet0/0/0 has entered the UP state. [R3-GigabitEthernet0/0/0]q [R3]ip route-static 10.1.1.0 24 10.1.123.1 #pc3reply的目标主机段和需要经过的地址段 |
今日新闻 |
推荐新闻 |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |