mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2025-04-09 22:27:28 +03:00
adds 5 new chains to the uci firewall that can be used to hook custom rules
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@12395 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
parent
833c6d3623
commit
4927575ba5
@ -261,6 +261,19 @@ fw_addif() {
|
|||||||
(ACTION="ifup" INTERFACE="$1" . /etc/hotplug.d/iface/20-firewall)
|
(ACTION="ifup" INTERFACE="$1" . /etc/hotplug.d/iface/20-firewall)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fw_custom_chains() {
|
||||||
|
$IPTABLES -N input_rule
|
||||||
|
$IPTABLES -N output_rule
|
||||||
|
$IPTABLES -N forward_rule
|
||||||
|
$IPTABLES -N prerouting_rule -t nat
|
||||||
|
$IPTABLES -N postrouting_rule -t nat
|
||||||
|
$IPTABLES -A INPUT -j input_rule
|
||||||
|
$IPTABLES -A OUTPUT -j output_rule
|
||||||
|
$IPTABLES -A FORWARD -j forward_rule
|
||||||
|
$IPTABLES -A PREROUTING -t nat -j prerouting_rule
|
||||||
|
$IPTABLES -A POSTROUTING -t nat -j postrouting_rule
|
||||||
|
}
|
||||||
|
|
||||||
fw_init() {
|
fw_init() {
|
||||||
echo "Loading defaults"
|
echo "Loading defaults"
|
||||||
config_foreach fw_defaults defaults
|
config_foreach fw_defaults defaults
|
||||||
@ -274,6 +287,8 @@ fw_init() {
|
|||||||
config_foreach fw_redirect redirect
|
config_foreach fw_redirect redirect
|
||||||
echo "Loading includes"
|
echo "Loading includes"
|
||||||
config_foreach fw_include include
|
config_foreach fw_include include
|
||||||
|
echo "Adding custom chains"
|
||||||
|
fw_custom_chains
|
||||||
|
|
||||||
uci_set_state firewall core "" firewall_state
|
uci_set_state firewall core "" firewall_state
|
||||||
uci_set_state firewall core loaded 1
|
uci_set_state firewall core loaded 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user