eNSP一:配置路由

tech2024-06-02  66

eNSP简介

这是一款由华为提供的免费的、可扩展的、图形化操作的网络仿真工具平台,主要对企业网络路由器、交换机进行软件仿真。 笔者刚刚使用,个人感觉紧密结合了计算机网络的理论知识,动手实操。

搭建拓扑图

点击左上角新建拓扑,选中路由器和PC机,连接拓扑图。注意:路由器建议选择AR2240型号(如下图所示)

这里我直接打开了.paper文件,里面有现成的拓扑图。自己连接也是很简单的。

任务

按标示配置IP地址AR1、AR2配置静态路由AR3配置缺省路由

配置静态路由-AR1

双击AR1打开命令行窗口

进入系统视图

<Huawei>system-view [Huawei]sysname R1 \\命名路由器AR1为R1 进入AR1接口,由拓扑图得到,AR1 GE 0/0/1直连的网关是192.168.1.1/24 [R1]interface g0/0/1 [R1-GigabitEthernet0/0/1]ip address 192.168.1.1 24 \\192.168.1.1 24是PC1的网关 [R1-GigabitEthernet0/0/1]quit [R1]

同理可得,AR1 GE 0/0/0

[R1]interface g0/0/0 [R1-GigabitEthernet0/0/0]ip address 10.1.12.1 24 [R1-GigabitEthernet0/0/0]quit [R1] AR1静态路由 ip route-static 192.168.2.0 24 10.1.12.2 \\192.168.2.0是指PC2处,24是指掩码数

###配置静态路由-AR2

进入系统视图、系统命名省略。配置GE 0/0/0和GE 0/0/1 [R2]interface g0/0/0 [R2-GigabitEthernet0/0/0]ip address 10.1.12.2 24 [R2-GigabitEthernet0/0/0]quit [R2]interface g0/0/1 [R2-GigabitEthernet0/0/1]ip address 10.1.23.2 24 配置静态路由 [R2]ip route-static 192.168.1.0 24 10.1.12.1 [R2]ip route-static 192.168.2.0 24 10.1.23.3

配置缺省路由-AR3

AR3两个接口的配置 [R3]interface g0/0/1 [R3-GigabitEthernet0/0/1]ip address 192.168.2.1 24 !!!注意这里是192.168.2.1而不是192.168.2.10 [R3]interface g0/0/0 [R3-GigabitEthernet0/0/0]ip address 10.1.23.3 24 AR3缺省路由 [R3]ip route-static 0.0.0.0 0 10.1.23.2 查看AR3接口 [R3]display ip interface brief *down: administratively down ^down: standby (l): loopback (s): spoofing The number of interface that is UP in Physical is 3 The number of interface that is DOWN in Physical is 1 The number of interface that is UP in Protocol is 3 The number of interface that is DOWN in Protocol is 1 Interface IP Address/Mask Physical Protocol GigabitEthernet0/0/0 10.1.23.3/24 up up GigabitEthernet0/0/1 192.168.2.1/24 up up GigabitEthernet0/0/2 unassigned down down NULL0 unassigned up up(s) 查看AR3路由表 到达192.168.2.0/24的下一跳是192.168.2.10 缺省路由的下一跳是10.1.23.2 [R1]display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 11 Routes : 11 Destination/Mask Proto Pre Cost Flags NextHop Interface 0.0.0.0/0 Static 60 0 RD 10.1.23.2 GigabitEthernet 0/0/0 10.1.23.0/24 Direct 0 0 D 10.1.23.3 GigabitEthernet 0/0/0 10.1.23.3/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 10.1.23.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.2.0/24 Direct 0 0 D 192.168.2.10 GigabitEthernet 0/0/1 192.168.2.10/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 192.168.2.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 查看AR2的路由表 到达192.168.1.0的下一跳是10.1.12.1 到达192.168.2.0的下一跳是10.1.23.3 [R2]display ip routing-table Route Flags: R - relay, D - download to fib ------------------------------------------------------------------------------ Routing Tables: Public Destinations : 12 Routes : 12 Destination/Mask Proto Pre Cost Flags NextHop Interface 10.1.12.0/24 Direct 0 0 D 10.1.12.2 GigabitEthernet 0/0/0 10.1.12.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 10.1.12.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/0 10.1.23.0/24 Direct 0 0 D 10.1.23.2 GigabitEthernet 0/0/1 10.1.23.2/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 10.1.23.255/32 Direct 0 0 D 127.0.0.1 GigabitEthernet 0/0/1 127.0.0.0/8 Direct 0 0 D 127.0.0.1 InLoopBack0 127.0.0.1/32 Direct 0 0 D 127.0.0.1 InLoopBack0 127.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0 192.168.1.0/24 Static 60 0 RD 10.1.12.1 GigabitEthernet 0/0/0 192.168.2.0/24 Static 60 0 RD 10.1.23.3 GigabitEthernet 0/0/1 255.255.255.255/32 Direct 0 0 D 127.0.0.1 InLoopBack0

验证

双击PC1或者PC2,在命令行ping对方的IP地址不报错就说明

最新回复(0)