interface Vlan-interface100
private-vlan secondary 101 to 144
ip address 192.168.1.250 255.255.255.0
#
interface GigabitEthernet1/0/1
port link-mode bridge
port link-type hybrid
undo port hybrid vlan 1
port hybrid vlan 100 to 101 untagged
port hybrid pvid vlan 101
port private-vlan host
packet-filter name deny-wannacry inbound
(0)
最佳答案
这些配置的作用如下:
interface Vlan-interface100
配置了一个VLAN接口,这是一个虚拟接口,通常用于路由功能。
private-vlan secondary 101 to 144
表示这个VLAN接口被配置为私有VLAN的主VLAN,并且关联了从101到144的次级VLAN。ip address 192.168.1.250 255.255.255.0
为这个VLAN接口分配了一个IP地址和子网掩码。interface GigabitEthernet1/0/1
配置了一个千兆以太网接口。
port link-mode bridge
设置端口工作在桥接模式,即二层模式。port link-type hybrid
设置端口为混合类型,可以同时接收标记和未标记的VLAN帧。undo port hybrid vlan 1
移除了端口对VLAN 1的默认成员关系。port hybrid vlan 100 to 101 untagged
设置端口接收VLAN 100到101的未标记帧。port hybrid pvid vlan 101
设置端口的默认VLAN ID为101,未标记帧会被归入此VLAN。port private-vlan host
配置端口为私有VLAN的主机端口,只能与promiscuous端口通信。packet-filter name deny-wannacry inbound
应用了一个名为“deny-wannacry”的包过滤规则,用于入站流量,可能是用来防止WannaCry勒索软件的网络流量。如果终端设备接入到GigabitEthernet1/0/1端口后无法与核心网络通信,可能的原因包括:
为了解决通信问题,你可以检查以下设置:
如果需要更详细的帮助,我可以提供更多的网络故障排除建议。🌐
(0)
private-vlan
检测下私有vlan访问控制,参考案列
· Device A上的VLAN 10为Primary VLAN,包含上行端口GigabitEthernet1/0/1并关联两个Secondary VLAN(VLAN 2和VLAN 3),VLAN 2包含端口GigabitEthernet1/0/2,VLAN 3包含端口GigabitEthernet1/0/3。VLAN接口10的IP地址为192.168.1.1/24。
· 实现各Secondary VLAN间二层隔离和三层互通。
图3-5 组网图
# 配置VLAN 10为Primary VLAN。
<DeviceA> system-view
[DeviceA] vlan 10
[DeviceA-vlan10] private-vlan primary
[DeviceA-vlan10] quit
# 创建Secondary VLAN 2、3。
[DeviceA] vlan 2 to 3
# 配置Primary VLAN 10和Secondary VLAN 2、3的映射关系。
[DeviceA] vlan 10
[DeviceA-vlan10] private-vlan secondary 2 3
[DeviceA-vlan10] quit
# 配置上行端口GigabitEthernet1/0/1在VLAN 10中工作在promiscuous模式。
[DeviceA] interface gigabitethernet 1/0/1
[DeviceA-GigabitEthernet1/0/1] port private-vlan 10 promiscuous
[DeviceA-GigabitEthernet1/0/1] quit
# 将下行端口GigabitEthernet1/0/2加入VLAN 2,并配置其工作在host模式。
[DeviceA] interface gigabitethernet 1/0/2
[DeviceA-GigabitEthernet1/0/2] port access vlan 2
[DeviceA-GigabitEthernet1/0/2] port private-vlan host
[DeviceA-GigabitEthernet1/0/2] quit
# 将下行端口GigabitEthernet1/0/3加入VLAN 3,并配置其工作在host模式。
[DeviceA] interface gigabitethernet 1/0/3
[DeviceA-GigabitEthernet1/0/3] port access vlan 3
[DeviceA-GigabitEthernet1/0/3] port private-vlan host
[DeviceA-GigabitEthernet1/0/3] quit
# 配置Primary VLAN 10下Secondary VLAN 2、3之间三层互通。
[DeviceA] interface vlan-interface 10
[DeviceA-Vlan-interface10] private-vlan secondary 2 3
# 配置VLAN接口10的IP地址为192.168.1.1/24。
[DeviceA-Vlan-interface10] ip address 192.168.1.1 255.255.255.0
# 开启本地代理ARP功能。
[DeviceA-Vlan-interface10] local-proxy-arp enable
[DeviceA-Vlan-interface10] quit
# 查看Private VLAN 10的相关信息,验证以上配置是否生效。
[DeviceA] display private-vlan 10
Primary VLAN ID: 10
Secondary VLAN ID: 2-3
VLAN ID: 10
VLAN type: Static
Private VLAN type: Primary
Route interface: Configured
IPv4 address: 192.168.1.1
IPv4 subnet mask: 255.255.255.0
Description: VLAN 0010
Name: VLAN 0010
Tagged ports: None
Untagged ports:
GigabitEthernet1/0/1
GigabitEthernet1/0/2
GigabitEthernet1/0/3
VLAN ID: 2
VLAN type: Static
Private VLAN type: Secondary
Route interface: Configured
IPv4 address: 192.168.1.1
IPv4 subnet mask: 255.255.255.0
Description: VLAN 0002
Name: VLAN 0002
Tagged ports: None
Untagged ports:
GigabitEthernet1/0/1
GigabitEthernet1/0/2
VLAN ID: 3
VLAN type: Static
Private VLAN type: Secondary
Route interface: Configured
IPv4 address: 192.168.1.1
IPv4 subnet mask: 255.255.255.0
Description: VLAN 0003
Name: VLAN 0003
Tagged ports: None
Untagged ports:
GigabitEthernet1/0/1
GigabitEthernet1/0/3
可以看到,Secondary VLAN 2和Secondary VLAN 3的Route interface字段都显示为Configured,说明Secondary VLAN 2与Secondary VLAN 3间已配置三层互通。
(0)
暂无评论
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明
暂无评论