配置示例:公司财务可访问其他部门,其他部门不能访问财务部

  1. 网络拓扑假设
    • 假设公司网络通过一台华为三层交换机连接各个部门,各部门处于不同的 VLAN。VLAN 10 为财务部,VLAN 20 为市场部,VLAN 30 为销售部。
  2. 配置步骤
    • VLAN 配置
      • 创建 VLAN:
system - view
vlan batch 10 20 30
  • 将接口划分到相应 VLAN(假设接口 GigabitEthernet0/0/1 - 0/0/5 属于财务部,接口 GigabitEthernet0/0/6 - 0/0/10 属于市场部,接口 GigabitEthernet0/0/11 - 0/0/15 属于销售部):
interface GigabitEthernet0/0/1
port link - type access
port default vlan 10
quit
interface GigabitEthernet0/0/6
port link - type access
port default vlan 20
quit
interface GigabitEthernet0/0/11
port link - type access
port default vlan 30
quit
  • 接口配置 IP 地址作为各 VLAN 的网关
    • 为 VLAN 10 配置网关:
interface Vlanif10
ip address 192.168.10.1 255.255.255.0
quit
  • 为 VLAN 20 配置网关:
interface Vlanif20
ip address 192.168.20.1 255.255.255.0
quit
  • 为 VLAN 30 配置网关:
interface Vlanif30
ip address 192.168.30.1 255.255.255.0
quit
  • 配置访问控制列表(ACL)实现访问控制
    • 创建 ACL 规则允许财务部访问其他部门:
acl number 3000
rule 5 permit ip source 192.168.10.0 0.0.0.255 destination 192.168.20.0 0.0.0.255
rule 10 permit ip source 192.168.10.0 0.0.0.255 destination 192.168.30.0 0.0.0.255
rule 15 permit ip source 192.168.10.0 0.0.0.255 destination any
  • 创建 ACL 规则禁止其他部门访问财务部:
acl number 3001
rule 5 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.10.0 0.0.0.255
rule 10 deny ip source 192.168.30.0 0.0.0.255 destination 192.168.10.0 0.0.0.255
rule 15 permit ip source any destination any
  • 创建 ACL 规则禁止其他部门相互访问:
acl number 3002
rule 5 deny ip source 192.168.20.0 0.0.0.255 destination 192.168.30.0 0.0.0.255
rule 10 deny ip source 192.168.30.0 0.0.0.255 destination 192.168.20.0 0.0.0.255
rule 15 permit ip source any destination any
  • 将 ACL 应用到 VLAN 接口的入方向实现访问控制
    • 将禁止访问财务部的 ACL 应用到 VLAN 20 和 VLAN 30 的入方向:
interface Vlanif20
traffic - filter inbound acl 3001
quit
interface Vlanif30
traffic - filter inbound acl 3001
quit
  • 将禁止部门间相互访问的 ACL 应用到 VLAN 20 和 VLAN 30 的入方向:
interface Vlanif20
traffic - filter inbound acl 3002
quit
interface Vlanif30
traffic - filter inbound acl 3002
quit
  • 将允许财务部访问其他部门的 ACL 应用到 VLAN 10 的入方向:
interface Vlanif10
traffic - filter inbound acl 3000
quit
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值