vlan 11
ip-subnet-vlan 0 ip 138.166.1.0 255.255.255.0
vlan 12
ip-subnet-vlan 0 ip 138.166.2.0 255.255.255.0
vlan 13
ip-subnet-vlan 0 ip 138.166.3.0 255.255.255.0
int range g1/0/1 to g1/0/46
port link-type hybrid
po hy vlan 11 12 13 untagg
port hybrid ip-subnet-vlan vlan 1
port hybrid ip-subnet-vlan vlan 100
port hybrid ip-subnet-vlan vlan 11
port hybrid ip-subnet-vlan vlan 12
port hybrid ip-subnet-vlan vlan 13
这是v7版本的vlan命令,求一个vlan下ip-subnet-vlan v5翻译命令
vlan 11
ip-subnet-vlan 0 ip 138.166.1.0 255.255.255.0
(0)
最佳答案
您好,参考
如下图所示,办公区的主机属于不同的网段192.168.5.0/24和192.168.50.0/24,Device C在收到来自办公区主机的报文时,根据报文的源IP地址,使来自不同网段主机的报文分别在指定的VLAN中传输,其中,来自网段192.168.5.0/24的报文在VLAN 100中传输,来自网段192.168.50.0/24的报文在VLAN 200中传输。
图1-6 基于IP子网的VLAN组网图
(1) 配置Device C
# 配置子网192.168.5.0/24与VLAN 100关联。
<DeviceC> system-view
[DeviceC] vlan 100
[DeviceC-vlan100] ip-subnet-vlan ip 192.168.5.0 255.255.255.0
[DeviceC-vlan100] quit
# 配置子网192.168.50.0/24与VLAN 200关联。
[DeviceC] vlan 200
[DeviceC-vlan200] ip-subnet-vlan ip 192.168.50.0 255.255.255.0
[DeviceC-vlan200] quit
# 配置端口GigabitEthernet1/0/2为Hybrid端口,允许VLAN 100通过,并且在发送VLAN 100的报文时携带VLAN Tag。
[DeviceC] interface gigabitethernet 1/0/2
[DeviceC-GigabitEthernet1/0/2] port link-type hybrid
[DeviceC-GigabitEthernet1/0/2] port hybrid vlan 100 tagged
[DeviceC-GigabitEthernet1/0/2] quit
# 配置端口GigabitEthernet1/0/3为Hybrid端口,允许VLAN 200通过,并且在发送VLAN 200的报文时携带VLAN Tag。
[DeviceC] interface gigabitethernet 1/0/3
[DeviceC-GigabitEthernet1/0/3] port link-type hybrid
[DeviceC-GigabitEthernet1/0/3] port hybrid vlan 200 tagged
[DeviceC-GigabitEthernet1/0/3] quit
# 配置端口GigabitEthernet1/0/1为Hybrid端口,允许VLAN 100、200通过,并且在发送VLAN 100、200的报文时不携带VLAN Tag。
[DeviceC] interface gigabitethernet 1/0/1
[DeviceC-GigabitEthernet1/0/1] port link-type hybrid
[DeviceC-GigabitEthernet1/0/1] port hybrid vlan 100 200 untagged
# 配置端口GigabitEthernet1/0/1和基于IP子网的VLAN 100、200关联。
[DeviceC-GigabitEthernet1/0/1] port hybrid ip-subnet-vlan vlan 100
[DeviceC-GigabitEthernet1/0/1] port hybrid ip-subnet-vlan vlan 200
[DeviceC-GigabitEthernet1/0/1] quit
(2) 配置Device A和Device B
配置Device A和Device B允许对应VLAN通过,配置过程略。
# 查看所有子网VLAN的信息。
[DeviceC] display ip-subnet-vlan vlan all
VLAN ID: 100
Subnet index IP address Subnet mask
0 192.168.5.0 255.255.255.0
VLAN ID: 200
Subnet index IP address Subnet mask
0 192.168.50.0 255.255.255.0
# 查看端口GigabitEthernet1/0/1关联的子网VLAN的信息。
[DeviceC] display ip-subnet-vlan interface gigabitethernet 1/0/1
Interface: GigabitEthernet1/0/1
VLAN ID Subnet index IP address Subnet mask Status
100 0 192.168.5.0 255.255.255.0 Active
200 0 192.168.50.0 255.255.255.0 Active
(0)
如图1-9所示,办公区的主机属于不同的网段192.168.5.0/24和192.168.50.0/24,Device C在收到来自办公区主机的报文时,根据报文的源IP地址,使来自不同网段主机的报文分别在指定的VLAN中传输。
图1-9 基于IP子网的VLAN组网图
创建VLAN100、VLAN200,配置子网与VLAN的关联关系,并配置端口与VLAN的关联关系。
<DeviceC> system-view
# 配置子网192.168.5.0/24与VLAN 100关联。
[DeviceC] vlan 100
[DeviceC-vlan100] ip-subnet-vlan ip 192.168.5.0 255.255.255.0
[DeviceC-vlan100] quit
# 配置子网192.168.50.0/24与VLAN 200关联。
[DeviceC] vlan 200
[DeviceC-vlan200] ip-subnet-vlan ip 192.168.50.0 255.255.255.0
[DeviceC-vlan200] quit
# 配置端口GigabitEthernet 1/0/11,使其允许通过VLAN 100的报文。
[DeviceC] interface gigabitethernet 1/0/11
[DeviceC-GigabitEthernet1/0/11] port link-type hybrid
[DeviceC-GigabitEthernet1/0/11] port hybrid vlan 100 tagged
Please wait... Done.
[DeviceC-GigabitEthernet1/0/11] quit
# 配置端口GigabitEthernet 1/0/12,使其允许通过VLAN 200的报文。
[DeviceC] interface gigabitethernet 1/0/12
[DeviceC-GigabitEthernet1/0/12] port link-type hybrid
[DeviceC-GigabitEthernet1/0/12] port hybrid vlan 200 tagged
Please wait... Done.
[DeviceC-GigabitEthernet1/0/12] quit
# 配置端口GigabitEthernet 1/0/1,使其和基于IP子网的VLAN 100、VLAN 200关联。
[DeviceC] interface gigabitethernet 1/0/1
[DeviceC-GigabitEthernet1/0/1] port link-type hybrid
[DeviceC-GigabitEthernet1/0/1] port hybrid vlan 100 200 untagged
Please wait... Done.
[DeviceC-GigabitEthernet1/0/1] port hybrid ip-subnet-vlan vlan 100
[DeviceC-GigabitEthernet1/0/1] port hybrid ip-subnet-vlan vlan 200
[DeviceC-GigabitEthernet1/0/1] return
# 查看所有VLAN的IP子网信息。
<Device C> display ip-subnet-vlan vlan all
VLAN ID: 100
Subnet Index IP Address Subnet Mask
====================================================
0 192.168.5.0 255.255.255.0
VLAN ID: 200
Subnet Index IP Address Subnet Mask
====================================================
0 192.168.50.0 255.255.255.0
# 查看端口GigabitEthernet 1/0/1上所配置的IP子网VLAN信息。
<DeviceC> display ip-subnet-vlan interface gigabitethernet 1/0/1
Interface: GigabitEthernet1/0/1
VLAN ID Subnet-Index IP ADDRESS NET MASK
=======================================================
100 0 192.168.5.0 255.255.255.0
200 0 192.168.50.0 255.255.255.0
基于IP子网的VLAN只对Hybrid端口配置才有效。
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论