重要配置如下:
1、进入子接口,配置IP地址,并进行802.1Q封装。
[USG2130]int e0/0/0.1
[USG2130-Ethernet0/0/0.1]description VLAN10
[USG2130-Ethernet0/0/0.1]ip address 192.168.1.1 24
[USG2130-Ethernet0/0/0.1]vlan-type dot1q 10
[USG2130][USG2130]int e0/0/0.2
[USG2130-Ethernet0/0/0.2]description VLAN20
[USG2130-Ethernet0/0/0.2]ip add 192.168.2.1 24
[USG2130-Ethernet0/0/0.2]vlan-type dot1q 20
[USG2130]int e0/0/0.3
[USG2130-Ethernet0/0/0.3]description VLAN30
[USG2130-Ethernet0/0/0.3]ip add 192.168.3.1 24
[USG2130-Ethernet0/0/0.3]vlan-type dot1q 30
2、创建用于连接互联网的VLAN,并配置IP。
[USG2130]vlan 3
[USG2130-vlan3]description WAN
[USG2130]int e1/0/0
[USG2130-Ethernet1/0/0]port access vlan 3
[USG2130]int vlan 3
[USG2130-Vlanif3]description TO-INTERNET
[USG2130-Vlanif3]ip add 100.100.100.1 30
3、自定义三个区域,并将各VLAN子接口加入区域,将Vlanif 3加入untrust区域
[USG2130]firewall zone name lan1
[USG2130-zone-lan1]set priority 60
[USG2130-zone-lan1]add interface e0/0/0.1
[USG2130]firewall zone name lan2
[USG2130-zone-lan2]set priority 65
[USG2130-zone-lan2]add interface e0/0/0.2
[USG2130]firewall zone name lan3
[USG2130-zone-lan3]set priority 70
[USG2130-zone-lan3]add interface e0/0/0.3
[USG2130]firewall zone untrust
[USG2130-zone-untrust]add interface vlan3
4、创建用于VLAN间访问控制的ACL,并应用于VLAN所在区域间。
[USG2130]acl 3001
[USG2130-acl-adv-3001]rule permit ip source 192.168.3.0 0.0.0.255
[USG2130]acl 3002
[USG2130-acl-adv-3002]rule deny ip source 192.168.1.0 0.0.0.255 destination 192.168.3.0 0.0.0.255
[USG2130-acl-adv-3002]rule deny ip source 192.168.2.0 0.0.0.255 destination 192.168.3.0 0.0.0.255
[USG2130-acl-adv-3002]rule permit ip
[USG2130]firewall interzone lan1 lan3
[USG2130-interzone-lan3-lan1]packet-filter 3001 outbound
[USG2130-interzone-lan3-lan1]packet-filter 3001 inbound
[USG2130]firewall interzone lan2 lan3
[USG2130-interzone-lan3-lan2]packet-filter 3001 outbound
[USG2130-interzone-lan3-lan2]packet-filter 3002 inbound
5、(可选)改变接口Ethernet0/0/0的区域
[USG2130-Vlanif3]fire zone untrust
[USG2130-zone-untrust]undo add interface e0/0/0
[USG2130-zone-untrust]firewall zone trust
[USG2130-zone-trust]add interface e0/0/0
6、完成NAT配置
[USG2130-zone-trust]acl 2000
[USG2130-acl-basic-2000]rule permit source 192.168.0.0 0.0.0.3
[USG2130]firewall interzone trust untrust
[USG2130-interzone-trust-untrust]nat outbound 2000 interface vlan 3