VLANIF实现VLAN之间的通信

Posted 大大大S

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了VLANIF实现VLAN之间的通信相关的知识,希望对你有一定的参考价值。

VLANIF实现VLAN之间的通信

  • 实验拓扑图

  • 实验要求
    1.修改交换机名称为S2 S3
    2.在S2 S3上做适当配置,使得3个VLAN之间能够通信

  • 配置
    交换机S2:

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]sysname S2  //修改交换机名称为S2
[S2]undo info-center enable   //关闭域名解析信息提示
Info: Information center is disabled.
[S2]vlan batch 10 20 30
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-Ethernet0/0/1]port link-type access 
[S2-Ethernet0/0/1]port default vlan 10
[S2-Ethernet0/0/1]int e0/0/2		
[S2-Ethernet0/0/2]port link-type access 	
[S2-Ethernet0/0/2]port default vlan 20
[S2-Ethernet0/0/2]int e0/0/3	
[S2-Ethernet0/0/3]port link-type access 	
[S2-Ethernet0/0/3]port default vlan 30
[S2-Ethernet0/0/3]int e0/0/4	
[S2-Ethernet0/0/4]port link-type trunk 
[S2-Ethernet0/0/4]port trunk allow-pass vlan 10 20 30
[S2-Ethernet0/0/4]          	//可以直接按 Ctrl+Z 返回用户视图
<S2>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.

交换机S3:

<Huawei>system-view 
Enter system view, return user view with Ctrl+Z.
[Huawei]UNDO info-center enable 
Info: Information center is disabled.
[Huawei]sysname S3
[S3]vlan batch 10 20 30
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3]int g0/0/1
[S3-GigabitEthernet0/0/1]port link-type trunk 	
[S3-GigabitEthernet0/0/1]port trunk allow-pass vlan 10 20 30
[S3-GigabitEthernet0/0/1]quit 

#配置VLANIF10 VLANIF20 VLANIF30,这三个逻辑接口的IP地作为PC的默认网关地址
[S3]interface Vlanif 10
[S3-Vlanif10]ip address 10.0.0.99 24
[S3-Vlanif10]quit 

[S3]interface Vlanif 20
[S3-Vlanif20]ip address 172.16.1.99 24
[S3-Vlanif20]quit 

[S3]interface Vlanif 30
[S3-Vlanif30]ip address 192.168.1.99 24
[S3-Vlanif30]quit 
<S3>save
The current configuration will be written to the device.
Are you sure to continue?[Y/N]y
Now saving the current configuration to the slot 0.
Save the configuration successfully.

  • 测试

PC1-1 ping PC2-1;PC2-1 ping PC3-1;PC3-1 ping PC1-1 :都能够实现通信

以上是关于VLANIF实现VLAN之间的通信的主要内容,如果未能解决你的问题,请参考以下文章

配置通过VLANIF实现跨设备VLAN内通信

网络方面,VLAN之间的关系

对比如下三种方式实现Vlan之间通信的利与弊

交换基础之VLAN间的通信

Huawei vlan 配置及vlan 间通讯

华为交换机VLAN配置命令