路由器间利用静态路由或动态路由RIP实现全网互通、以及远程登陆的实现

it2024-11-19  2

计算机网络原理

一、实验拓扑图

二、实验具体要求

1、根据以上拓扑划分VLAN,严格按照标明IP地址(除路由器与路由器连接段IP 地址按要求更换外)以及设备名称配置(否则不给分),实现全网的连通。

2、S5700划分两个VLAN,VLAN 20、 VLAN 30,其中G0/0/2–5属于VLAN20 ,G0/0/6–10属于VLAN 30。

3、AR2220-1 、AR2220-2、AR2220-3路由器通过以太口直连,路由器间利用静态路由或动态路由RIP实现全网互通。AR2220-1 、AR2220-3连接段IP地址为C类地址块,第三字节为1XX (XX为班级最后两位);AR2220-2 、AR2220-3连接段IP地址为C类地址块第三个字节为自己的学号后两位。 例如:班级是1801班,学号为2018100610号的学生 IP网段如下: 192.168.101.0 /24和192.168.10.0/24     4、在S5700上配置使用用户名和密码可远程登录,用户名命名规范如下: 用户名为自己姓名的汉语全拼,密码:123456


三、具体实验步骤

1.连接拓扑图如图所示(用的是eNSP)

配置好PC机上的ip地址、子网掩码以及网关如图所示

2.配置LSW1

LSW1: System-view [Huawei]vlan batch 20 30 [Huawei]int g0/0/2 [Huawei-GigabitEthernet0/0/2]port link-type access [Huawei-GigabitEthernet0/0/2]port default vlan 20 [Huawei-vlan2]port g0/0/2 [Huawei-vlan2]q

[Huawei]int g0/0/6 [Huawei-GigabitEthernet0/0/6]port link-type access [Huawei-GigabitEthernet0/0/6]port default vlan 30 [Huawei-vlan3]port g0/0/6 [Huawei-vlan3]q

[Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/1]port link-type trunk [Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan all [Huawei-GigabitEthernet0/0/1]q

[Huawei]int vlan1 [Huawei-Vlanif1]ip address 172.18.1.1 255.255.255.0 [Huawei-Vlanif1]q

[Huawei]int vlan 20 [Huawei-Vlanif20] [Huawei-Vlanif20]ip address 172.18.2.1 255.255.255.0 [Huawei-Vlanif20]q

[Huawei]int vlan 30 [Huawei-Vlanif30]ip address 172.18.3.1 255.255.255.0 [Huawei-Vlanif30]q

[Huawei]ip route-static 0.0.0.0 0 172.18.1.2 [Huawei]ip route-static 192.168.108.0 255.255.255.0 172.18.1.2

此时PC1 ping PC2 显示通则上述操作正确,如下图所示

3.配置路由器R1

路由器R1: System-view Enter system view, return user view [Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/1]ip address 172.18.1.2 255.255.255.0 [Huawei-GigabitEthernet0/0/1]q

[Huawei]int g0/0/0 [Huawei-GigabitEthernet0/0/0]ip address 192.168.108.1 255.255.255.0 [Huawei-GigabitEthernet0/0/0] [Huawei-GigabitEthernet0/0/0]q [Huawei] [Huawei]ip route-static 192.168.3.0 255.255.255.0 192.168.108.2 [Huawei] [Huawei]ip route-static 0.0.0.0 0 192.168.108.2 [Huawei]

[Huawei]ip route-static 192.168.0.0 16 172.18.1.1 [Huawei] [Huawei]ip route-static 172.18.0.0 16 172.18.1.1 [Huawei]

此时PC1 ping 192.168.108.1 显示通则上述操作正确

4.配置路由器R3

路由器R3: sys [Huawei] [Huawei]int g0/0/0 [Huawei-GigabitEthernet0/0/0]ip address 192.168.108.2 255.255.255.0 [Huawei-GigabitEthernet0/0/0] [Huawei-GigabitEthernet0/0/0]q

[Huawei]int g0/0/2 [Huawei-GigabitEthernet0/0/2]ip address 192.168.3.1 255.255.255.0 [Huawei-GigabitEthernet0/0/2] [Huawei-GigabitEthernet0/0/2]q

[Huawei]ip route-static 0.0.0.0 0 192.168.108.1 [Huawei] [Huawei]ip route-static 172.18.0.0 255.255.255.0 192.168.108.1 [Huawei] [Huawei]ip route-static 172.16.4.0 255.255.255.0 192.168.3.2 [Huawei]

此时PC1ping 192.168.108.2显示通则上述操作正确

5.配置路由器R2

路由器R2: sys Enter system view, return user view with Ctrl+Z. [Huawei] [Huawei]int g0/0/2 [Huawei-GigabitEthernet0/0/2]ip address 192.168.3.2 255.255.255.0 [Huawei-GigabitEthernet0/0/2]q [Huawei]int g0/0/1 [Huawei-GigabitEthernet0/0/1]ip address 172.16.4.1 255.255.255.0 [Huawei-GigabitEthernet0/0/1]q [Huawei] [Huawei]ip route-static 0.0.0.0 0 192.168.3.1 [Huawei] [Huawei]ip route-static 192.168.108.0 255.255.255.0 192.168.3.1 [Huawei]

此时PC1 ping 192.168.3.2 通则显示上述操作正确

6.远程登录

LSW1: [Huawei]aaa [Huawei-aaa]local-user zengzhiyou password cipher 123456 privilege level 3 Info: Add a new user. [Huawei-aaa]local-user zengzhiyou service-type telnet [Huawei-aaa] [Huawei-aaa]q [Huawei] [Huawei]user-interface vty 0 4 [Huawei-ui-vty0-4] [Huawei-ui-vty0-4]authentication-mode aaa [Huawei-ui-vty0-4] [Huawei]ip route-static 172.16.4.0 255.255.255.0 172.18.1.2

LSW2: sys [Huawei]int vlan1 [Huawei-Vlanif1]ip address 172.16.4.2 255.255.255.0 [Huawei-Vlanif1]q [Huawei] [Huawei]ip route-static 192.168.3.0 255.255.255.0 172.16.4.1 [Huawei] [Huawei]ip route-static 172.18.1.0 255.255.255.0 172.16.4.1 [Huawei] [Huawei]ip route-static 0.0.0.0 0 172.16.4.0 [Huawei] [Huawei]ip route-static 0.0.0.0 0 172.16.4.1 [Huawei]q telnet 172.18.1.1 输入LSW1的vlan1的IP地址 即 172.18.1.1 出现下述现象即上述操作正确

7.此时实现全网连通

PC1ping PC2 PC1 ping PC3 PC1 ping PC4

提示:以下是本人亲测,可供参考

最新回复(0)