三层交换机上两个VLAN,VLAN10和VLAN20,怎么配置能做到VLAN10可以访问VLAN20,VLAN20不能访问VLAN10
(0)
最佳答案
(0)
您好,请知:
可使用acl来实现,举例如下:
假设有vlan 10:192.168.10.0/24和vlan 20:192.168.20.0/24,允许vlan 10访问vlan 20,vlan20不能访问vlan 10,配置如下:
acl number 3000
rule 0 permit ip source 192.168.10.0 0.0.0.255 destination 192.168.20.0 0.0.0.255
quit
acl number 3001
rule 1 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.10.0 0.0.0.255
quit
vlan 10
quit
int vlan 10
ip address 192.168.10.1 24
packet-filter 3000 inbound
quit
vlan 20
ip address 192.168.20.1 24
packet-filter 3001 inbound
quit
(1)
测试了,无法ping通,两边都只能ping通到网关
参考下我修改的策略看下?
interface Vlan-interface10 ip address 192.168.10.254 255.255.255.0 packet-filter 3000 inbound # interface Vlan-interface20 ip address 192.168.20.254 255.255.255.0 packet-filter 3001 inbound interface GigabitEthernet1/0/1 port link-mode bridge port access vlan 10 interface GigabitEthernet1/0/2 port link-mode bridge port access vlan 20 combo enable fiber acl advanced 3000 rule 0 permit ip source 192.168.10.0 0.0.0.255 destination 192.168.20.0 0.0.0.255 # acl advanced 3001 rule 0 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.10.0 0.0.0.255
所有配置,太多了,不太好看
[H3C]dis acl all Advanced IPv4 ACL 3000, 1 rule, ACL's step is 5 rule 0 permit ip source 192.168.10.0 0.0.0.255 destination 192.168.20.0 0.0.0.255 (11 times matched) Advanced IPv4 ACL 3001, 1 rule, ACL's step is 5 rule 0 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.10.0 0.0.0.255 (20 times matched)
亲~登录后才可以操作哦!
确定你的邮箱还未认证,请认证邮箱或绑定手机后进行当前操作
举报
×
侵犯我的权益
×
侵犯了我企业的权益
×
抄袭了我的内容
×
原文链接或出处
诽谤我
×
对根叔社区有害的内容
×
不规范转载
×
举报说明