暂无图片
暂无图片
1
暂无图片
暂无图片
暂无图片

H3C低端以太网交换机配置指导-VLAN典型配置-基于端口

原创 愤怒的蜗牛 2022-10-24
458

通过划分VLAN,可以将传统的广播型局域网划分为多个广播域,实现虚拟工作组
的灵活配置。基于端口的VLAN是最简单的一种VLAN划分方法,用户可以将设备
上的端口划分到不同的VLAN中,此后从某个端口接收的报文将只能在相应的VLAN
内进行传输,从而实现广播域的隔离和虚拟工作组的划分。

配置过程和解释
z SwitchA的配置
# 在SwitchA上配置VLAN10,将连接服务器的Ethernet1/0/1端口加入VLAN10。
[SwitchA] vlan 10
[SwitchA-vlan10] port Ethernet 1/0/1
[SwitchA-vlan10] quit
# 在SwitchA上配置VLAN100,将连接工作站的Ethernet1/0/2端口加入VLAN100。
[SwitchA] vlan 100

[SwitchA-vlan100] port Ethernet 1/0/2
[SwitchA-vlan100] quit
# 在SwitchA上创建VLAN101和VLAN102。
[SwitchA] vlan 101 to 102
# 分别创建VLAN10、VLAN100、VLAN101、VLAN102接口,并配置相应的IP地
址。
[SwitchA] interface Vlan-interface 10
[SwitchA-Vlan-interface10] ip address 192.168.10.1 24
[SwitchA-Vlan-interface10] quit
[SwitchA] interface Vlan-interface 100
[SwitchA-Vlan-interface100] ip address 192.168.100.1 24
[SwitchA-Vlan-interface100] quit
[SwitchA] interface Vlan-interface 101
[SwitchA-Vlan-interface101] ip address 192.168.101.1 24
[SwitchA-Vlan-interface101] quit
[SwitchA] interface Vlan-interface 102
[SwitchA-Vlan-interface102] ip address 192.168.102.1 24
[SwitchA-Vlan-interface102] quit
# 在SwitchA上配置端口Ethernet1/0/3为Trunk端口,并配置允许VLAN101和
VLAN102的报文携带VLAN Tag通过。
[SwitchA] interface Ethernet 1/0/3
[SwitchA-Ethernet1/0/3] port link-type trunk
[SwitchA-Ethernet1/0/3] port trunk permit vlan 101 102
z SwitchB的配置
# 在SwitchB上配置VLAN101,将连接服务器的Ethernet1/0/11端口加入
VLAN101。
[SwitchB] vlan 101
[SwitchB-vlan101] port Ethernet 1/0/11
[SwitchB-vlan101] quit
# 在SwitchB上配置VLAN102,将连接工作站的Ethernet1/0/12端口加入
VLAN102。
[SwitchB] vlan 102
[SwitchB-vlan102] port Ethernet 1/0/12
[SwitchB-vlan102] quit
# 在SwitchB上配置端口Ethernet1/0/10为Trunk端口,并配置允许VLAN101和
VLAN102的报文携带VLAN Tag通过。
[SwitchB] interface Ethernet 1/0/10

[SwitchB-Ethernet1/0/10] port link-type trunk

完整配置
z SwitchA上的配置
#
vlan 10
#
vlan 100
#
vlan 101
#
vlan 102
#
interface Vlan-interface 10
ip address 192.168.10.1 255.255.255.0
#
interface Vlan-interface 100
ip address 192.168.100.1 255.255.255.0
#
interface Vlan-interface 101
ip address 192.168.101.1 255.255.255.0
#
interface Vlan-interface 102
ip address 192.168.102.1 255.255.255.0
#
interface Ethernet1/0/1
port access vlan 10
#
interface Ethernet1/0/2
port access vlan 100
#
interface Ethernet1/0/3
port link-type trunk
port trunk permit vlan 1 101 102
z SwitchB上的配置
#
vlan 101
#
vlan 102
#

interface Ethernet1/0/10

port link-type trunk
port trunk permit vlan 1 101 102
#
interface Ethernet1/0/11
port access vlan 101
#
interface Ethernet1/0/12

port access vlan 102 

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论