赞
踩
**静态路由# 学习目标:
了解静态路由原理和弊端
掌握配置静态路由的命令
成功配置静态路由
对静态路由排错的命令
静态路由
1、 规划拓扑图
2、 使用华为ensp模拟器配置静态路由
3、 掌握静态路由配置命令
4、排错命令
提示:2021/12/2
静态路由拓扑图(两台主机分别为10和20网段,需要经过三个路由器)
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口
sys
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
system-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口找到目标主机
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地址段和需要经过的路段是多少
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的目标主机段和需要经过的路段
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 © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。