华为模拟器用三层交换使网络互通实验报告

实验目的:

1.pc地址都是DHCP获取IP

2.C1,C3vlan10C2,C4vlan20,且实现互通;

3.pc都能访问外网;

4.AR2能够远程AR1

所需设备:

   使用ENSP模拟器模拟2台路由器 1台三层交换机2台二层交换机 4PC

实验拓扑图:

华为三层交换配置_第1张图片

实验步骤:

1.给二层交换机划分vlan,并把每个接口加入各自的vlan和建立中继口。

LSW1:划分vlan

[Huawei]vlan 10   划分vlan 10

[Huawei-vlan10]vlan 20   划分vlan 20

把接口加入vlan

[Huawei]int e0/0/1   进接口

[Huawei-Ethernet0/0/1]port link-type access  创建access

[Huawei-Ethernet0/0/1]port default vlan 10  把接口e0/0/1加入vlan 10

[Huawei]int e0/0/2

[Huawei-Ethernet0/0/1]port link-type access

[Huawei-Ethernet0/0/1]port default vlan 20

[Huawei-Ethernet0/0/2]intg0/0/1

配置中继口:

[Huawei-GigabitEthernet0/0/1]port link-type trunk   创建trunk

[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20创建中继口

华为三层交换配置_第2张图片

LSW2LSW1

2.给三层交换机划分vlan,并且建立中继口和配置每个vlan的网关地址。

[Huawei]vlan 10

[Huawei-vlan10]vlan 20

wKioL1VcUFawqcqgAACQoXBbSxc693.jpgwKiom1VcTwigNYnVAACEy1Cc75E992.jpg

配置中继口:

[Huawei-Vlanif20] g0/0/1

[Huawei-GigabitEthernet0/0/1]port link-type trunk

[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20

[Huawei-GigabitEthernet0/0/1] g0/0/2

[Huawei-GigabitEthernet0/0/1]port link-type trunk

[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20

wKiom1VcT0eSfReHAACvOx-_3O4837.jpg

配置中继口:

[Huawei-Vlanif20] g0/0/1

[Huawei-GigabitEthernet0/0/1]port link-type trunk

[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20

[Huawei-GigabitEthernet0/0/1] g0/0/2

[Huawei-GigabitEthernet0/0/1]port link-type trunk

[Huawei-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20

wKioL1VcUP-RCemuAABaE7zFlVY482.jpg

DHCP

[Huawei]dhcp enable  激活DHCP

[Huawei]int vlan 10进入虚拟vlan接口

[Huawei-Vlanif10]dhcp  select interface   开启vlan 10自动获取IP

[Huawei-Vlanif10]dhcp server dns-list 8.8.8.8   配置DNS

[Huawei-Vlanif10]int vlan 20

[Huawei-Vlanif20]dhcp  select interface

[Huawei-Vlanif20]dhcp server dns-list 9.9.9.9

wKiom1VcT6qCD1M6AABaE7zFlVY637.jpg

验证:

华为三层交换配置_第3张图片

3.能够让pc访问到AR1

[Huawei]vlan 100   创建vlan100

[Huawei-vlan100]int g0/0/3

[Huawei-GigabitEthernet0/0/3]port link-type access

[Huawei-GigabitEthernet0/0/3]port default vlan 100wKioL1VcUe_DS6AbAABhThmU-7E563.jpg


[Huawei-Vlanif100]int vlan 100

[Huawei-Vlanif100]ip add 192.168.1.1 24

[Huawei-Vlanif100]un shutdown

注:三层交换机没有三层接口所以给SW1g0/0/3AR1不好配置在一个网段,只能用虚拟vlan接口来配置IP

wKioL1VcUknC3phdAAA78iZuD9o164.jpg

[Huawei]ip route-static 0.0.0.0 0.0.0.0 192.168.1.2  配置三层交换机到AR1交换机的默认路由

wKioL1VcUnXzQmdtAAA-SVE3wAM034.jpg

AR1配置IP和静态路由。

[Huawei]int g0/0/0

[Huawei-GigabitEthernet0/0/0]ip add 192.168.1.2 24

[Huawei-GigabitEthernet0/0/0]un shutdown

wKiom1VcUSDTfOwfAABBzuoKn-k139.jpg

[Huawei]ip route-static 192.168.10.0 255.255.255.0 192.168.1.1  配置R110.0网段的静态路由

[Huawei]ip route-static 192.168.20.0 255.255.255.0 192.168.1.1  配置R120.0网段的静态路由

华为三层交换配置_第4张图片

4.pc用户能够访问外网。

配置路由器AR2IP

[Huawei]int g0/0/0

[Huawei-GigabitEthernet0/0/0]ip add 202.106.1.2 30

[Huawei-GigabitEthernet0/0/0]un shutdown


[Huawei]int g0/0/1

[Huawei-GigabitEthernet0/0/1]ip add 202.106.1.1 30

[Huawei-GigabitEthernet0/0/1]un shutdown


测试能够互通就行

 

给路由器AR1开启远程登录

[Huawei]user-interface vty 0 4

[Huawei-ui-vty0-4]au

[Huawei-ui-vty0-4]authentication-mode password

Please configure the login password (maximum length 16):123

[Huawei-ui-vty0-4]q

[Huawei]super password cipher abc123

[Huawei]q

 

AR2上测试远程登陆AR1,如图,登陆成功,实验结束

 

华为三层交换配置_第5张图片