VLAN间通信

实施环境:最新华为模拟器eNSP

1、要求:

现有一台路由器、三台交换机和四台PC机,PC1、PC3在VLAN 10中,PC2、PC4在VLAN 20中,要求能够实现不同VLAN间的通信。

2、网络拓扑图

wKioL1NbyH_QNZQFAAIU5Cmobv0236.jpg

3、设备配置

(1)路由器R1的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]sysname R1

[R1]int eth0/0/0.1

[R1-Ethernet0/0/0.1]ip add

[R1-Ethernet0/0/0.1]ip address 1

//VLAN打标签

[R1-Ethernet0/0/0.1]vlan-type dot1q 10

[R1-Ethernet0/0/0.1]quit

[R1]int eth0/0/0.2

//配置IP地址

[R1-Ethernet0/0/0.2]ip address 192.168.20.1 24

//VLAN打标签

[R1-Ethernet0/0/0.2]vlan-type dot1q 20

(2)交换机SW1的配置

<Huawei>system-view

Enter system view, return user view with Ctrl+Z.

[Huawei]sys

[Huawei]sysname SW1

//创建VLAN

[SW1]vlan10

[SW1-vlan10]vlan 20

[SW1]int eth0/0/1

//eth0/0/1设为trunk

[SW1-Ethernet0/0/1]port link-type trunk

//trunk下允许所有VLAN通过