q2009a06z22 发表于 2018-7-26 07:12:59

华为路由器交换VLAN配置实例

  四台PC的IP地址、掩码如下列表:
  P1 192.168.1.1 255.255.255.0 网关IP 为192.168.1.5
  P2 192.168.1.2 255.255.255.0 网关IP 为192.168.1.5
  P3 192.168.1.3 255.255.255.0 网关IP 为192.168.1.6
  P4 192.168.1.4 255.255.255.0 网关IP 为192.168.1.6
  路由器上Ethernet0的IP 为192.168.1.5
  Ethernet1的IP 为192.168.1.6
  firewall 设置默认为deny
  实施命令列表:
  交换机上设置,划分VLAN:
  sys
  //切换到系统视图
  vlan enable
  vlan 2
  port e0/1 to e0/8
  quit
  //默认所有端口都属于VLAN1,指定交换机的e0/1 到e0/8八个端口属于VLAN2
  vlan 3
  port e0/9 to e0/16
  quit
  //指定交换机的e0/9 到e0/16八个端口属于VLAN3
  dis vlan all
  dis cu
  路由器上设置,实现访问控制:
  interface ethernet 0
  ip address 192.168.1.5 255.255.255.0
  quit
  //指定ethernet 0的ip
  interface ethernet 1
  ip address 192.168.1.6 255.255.255.0
  quit
  //开启firewall,并将默认设置为deny
  fire enable
  fire default deny
  //允许192.168.1.1访问192.168.1.3
  //firewall策略可根据需要再进行添加
  acl 101
  rule permit ip source 192.168.1.1 255.255.255.0 destination 192.168.1.3 255.255.255.0
  quit
  //启用101规则
  fire pa 101
  quit
  fire pa 101
  quit
页: [1]
查看完整版本: 华为路由器交换VLAN配置实例