_______________________________________________________________________________________________________
_______________________________________________________________________________________________________
© Virtual Access 2018
GW1000 Series User Manual
Issue: 2.3
Page 314 of 463
31.3
Configuring firewall using UCI
Firewall is configured under the firewall package /etc/config/firewall.
There are three config sections: defaults, zone, forwarding, redirect, rule and include.
You can configure multiple zone, forwarding and redirect sections.
31.3.1
Firewall general settings
To set general (default) settings, enter:
uci add firewall defaults
uci set firewall.@defaults[0].syn_flood=1
uci set firewall.@defaults[0].drop_invalid=1
uci set firewall.@defaults[0].input=ACCEPT
uci set firewall.@defaults[0].output=ACCEPT
uci set firewall.@defaults[0].forward=ACCEPT
Note: this command is only required if there is no defaults section.
31.3.2
Firewall zone settings
By default, all firewall zone instances are named zone, instances are identified by
@zone
then the zone position in the package as a number. For example, for the first zone in the
package using UCI:
firewall.@zone[0]=zone
firewall.@zone[0].name=lan
Or using package options:
config zone
option name 'lan'
To set up a firewall zone, enter:
uci add firewall zone
uci set firewall.@zone[1].name=lan
uci set firewall.@zone[1].input=ACCEPT
uci set firewall.@zone[1].output=ACCEPT
uci set firewall.@zone[1].forward=ACCEPT
uci set firewall.@zone[1].network=lan1 wifi_client
uci set firewall.@zone[1].family=any
uci set firewall.@zone[1].masq_src=10.0.0.0/24
uci set firewall.@zone[1].masq_dest=20.0.0.0/24
uci set firewall.@zone[1].conntrack=1