2008-08-04 11:51:58 +00:00
|
|
|
config defaults
|
|
|
|
option syn_flood 1
|
2008-09-28 16:17:49 +00:00
|
|
|
option input ACCEPT
|
2012-04-21 19:42:28 +00:00
|
|
|
option output ACCEPT
|
2008-09-24 15:10:16 +00:00
|
|
|
option forward REJECT
|
2010-05-19 09:49:21 +00:00
|
|
|
# Uncomment this line to disable ipv6 rules
|
|
|
|
# option disable_ipv6 1
|
2008-08-04 11:51:58 +00:00
|
|
|
|
|
|
|
config zone
|
|
|
|
option name lan
|
2011-06-30 01:31:23 +00:00
|
|
|
option network 'lan'
|
2012-04-21 19:42:28 +00:00
|
|
|
option input ACCEPT
|
|
|
|
option output ACCEPT
|
2011-06-30 01:31:23 +00:00
|
|
|
option forward REJECT
|
2008-08-04 11:51:58 +00:00
|
|
|
|
|
|
|
config zone
|
|
|
|
option name wan
|
2011-06-30 01:31:23 +00:00
|
|
|
option network 'wan'
|
|
|
|
option input REJECT
|
2012-04-21 19:42:28 +00:00
|
|
|
option output ACCEPT
|
2011-06-30 01:31:23 +00:00
|
|
|
option forward REJECT
|
2012-04-21 19:42:28 +00:00
|
|
|
option masq 1
|
2011-06-30 01:31:23 +00:00
|
|
|
option mtu_fix 1
|
2008-08-04 11:51:58 +00:00
|
|
|
|
2012-04-21 19:42:28 +00:00
|
|
|
config forwarding
|
|
|
|
option src lan
|
|
|
|
option dest wan
|
2008-12-31 19:02:03 +00:00
|
|
|
|
2009-08-13 03:31:53 +00:00
|
|
|
# We need to accept udp packets on port 68,
|
|
|
|
# see https://dev.openwrt.org/ticket/4108
|
|
|
|
config rule
|
2011-12-20 01:10:15 +00:00
|
|
|
option name Allow-DHCP-Renew
|
2009-08-13 03:31:53 +00:00
|
|
|
option src wan
|
|
|
|
option proto udp
|
|
|
|
option dest_port 68
|
|
|
|
option target ACCEPT
|
2011-06-30 01:31:23 +00:00
|
|
|
option family ipv4
|
|
|
|
|
|
|
|
# Allow IPv4 ping
|
|
|
|
config rule
|
2011-12-20 01:10:15 +00:00
|
|
|
option name Allow-Ping
|
2011-06-30 01:31:23 +00:00
|
|
|
option src wan
|
|
|
|
option proto icmp
|
|
|
|
option icmp_type echo-request
|
|
|
|
option family ipv4
|
|
|
|
option target ACCEPT
|
|
|
|
|
2011-11-09 11:10:37 +00:00
|
|
|
# Allow DHCPv6 replies
|
|
|
|
# see https://dev.openwrt.org/ticket/10381
|
|
|
|
config rule
|
2011-12-20 01:10:15 +00:00
|
|
|
option name Allow-DHCPv6
|
2011-11-09 11:10:37 +00:00
|
|
|
option src wan
|
|
|
|
option proto udp
|
|
|
|
option src_ip fe80::/10
|
|
|
|
option src_port 547
|
|
|
|
option dest_ip fe80::/10
|
|
|
|
option dest_port 546
|
|
|
|
option family ipv6
|
|
|
|
option target ACCEPT
|
|
|
|
|
2011-06-30 01:31:23 +00:00
|
|
|
# Allow essential incoming IPv6 ICMP traffic
|
2011-08-14 00:33:29 +00:00
|
|
|
config rule
|
2011-12-20 01:10:15 +00:00
|
|
|
option name Allow-ICMPv6-Input
|
2011-08-14 00:33:29 +00:00
|
|
|
option src wan
|
|
|
|
option proto icmp
|
|
|
|
list icmp_type echo-request
|
2012-02-25 21:00:23 +00:00
|
|
|
list icmp_type echo-reply
|
2011-08-14 00:33:29 +00:00
|
|
|
list icmp_type destination-unreachable
|
|
|
|
list icmp_type packet-too-big
|
|
|
|
list icmp_type time-exceeded
|
|
|
|
list icmp_type bad-header
|
|
|
|
list icmp_type unknown-header-type
|
|
|
|
list icmp_type router-solicitation
|
|
|
|
list icmp_type neighbour-solicitation
|
|
|
|
option limit 1000/sec
|
|
|
|
option family ipv6
|
|
|
|
option target ACCEPT
|
|
|
|
|
|
|
|
# Allow essential forwarded IPv6 ICMP traffic
|
2012-04-21 19:42:28 +00:00
|
|
|
config rule
|
2011-12-20 01:10:15 +00:00
|
|
|
option name Allow-ICMPv6-Forward
|
2011-06-30 01:31:23 +00:00
|
|
|
option src wan
|
|
|
|
option dest *
|
|
|
|
option proto icmp
|
|
|
|
list icmp_type echo-request
|
2012-02-25 21:00:23 +00:00
|
|
|
list icmp_type echo-reply
|
2011-06-30 01:31:23 +00:00
|
|
|
list icmp_type destination-unreachable
|
|
|
|
list icmp_type packet-too-big
|
|
|
|
list icmp_type time-exceeded
|
2011-06-30 12:22:05 +00:00
|
|
|
list icmp_type bad-header
|
|
|
|
list icmp_type unknown-header-type
|
2011-06-30 01:31:23 +00:00
|
|
|
option limit 1000/sec
|
|
|
|
option family ipv6
|
|
|
|
option target ACCEPT
|
2009-08-13 03:31:53 +00:00
|
|
|
|
2009-04-12 22:38:34 +00:00
|
|
|
# include a file with users custom iptables rules
|
|
|
|
config include
|
|
|
|
option path /etc/firewall.user
|
|
|
|
|
2008-08-04 11:51:58 +00:00
|
|
|
|
|
|
|
### EXAMPLE CONFIG SECTIONS
|
|
|
|
# do not allow a specific ip to access wan
|
|
|
|
#config rule
|
|
|
|
# option src lan
|
|
|
|
# option src_ip 192.168.45.2
|
|
|
|
# option dest wan
|
|
|
|
# option proto tcp
|
2012-04-21 19:42:28 +00:00
|
|
|
# option target REJECT
|
2008-08-04 11:51:58 +00:00
|
|
|
|
|
|
|
# block a specific mac on wan
|
|
|
|
#config rule
|
|
|
|
# option dest wan
|
|
|
|
# option src_mac 00:11:22:33:44:66
|
2012-04-21 19:42:28 +00:00
|
|
|
# option target REJECT
|
2008-08-04 11:51:58 +00:00
|
|
|
|
|
|
|
# block incoming ICMP traffic on a zone
|
|
|
|
#config rule
|
|
|
|
# option src lan
|
|
|
|
# option proto ICMP
|
|
|
|
# option target DROP
|
|
|
|
|
|
|
|
# port redirect port coming in on wan to lan
|
|
|
|
#config redirect
|
|
|
|
# option src wan
|
|
|
|
# option src_dport 80
|
|
|
|
# option dest lan
|
|
|
|
# option dest_ip 192.168.16.235
|
2012-04-21 19:42:28 +00:00
|
|
|
# option dest_port 80
|
2008-08-26 07:23:29 +00:00
|
|
|
# option proto tcp
|
2008-08-04 11:51:58 +00:00
|
|
|
|
2011-05-02 12:54:31 +00:00
|
|
|
# port redirect of remapped ssh port (22001) on wan
|
|
|
|
#config redirect
|
|
|
|
# option src wan
|
|
|
|
# option src_dport 22001
|
|
|
|
# option dest lan
|
|
|
|
# option dest_port 22
|
|
|
|
# option proto tcp
|
|
|
|
|
|
|
|
# allow IPsec/ESP and ISAKMP passthrough
|
|
|
|
#config rule
|
|
|
|
# option src wan
|
|
|
|
# option dest lan
|
|
|
|
# option protocol esp
|
|
|
|
# option target ACCEPT
|
|
|
|
|
|
|
|
#config rule
|
|
|
|
# option src wan
|
|
|
|
# option dest lan
|
|
|
|
# option src_port 500
|
|
|
|
# option dest_port 500
|
|
|
|
# option proto udp
|
|
|
|
# option target ACCEPT
|
2008-08-04 11:51:58 +00:00
|
|
|
|
|
|
|
### FULL CONFIG SECTIONS
|
|
|
|
#config rule
|
|
|
|
# option src lan
|
|
|
|
# option src_ip 192.168.45.2
|
|
|
|
# option src_mac 00:11:22:33:44:55
|
|
|
|
# option src_port 80
|
|
|
|
# option dest wan
|
|
|
|
# option dest_ip 194.25.2.129
|
|
|
|
# option dest_port 120
|
|
|
|
# option proto tcp
|
2012-04-21 19:42:28 +00:00
|
|
|
# option target REJECT
|
2008-08-04 11:51:58 +00:00
|
|
|
|
|
|
|
#config redirect
|
|
|
|
# option src lan
|
|
|
|
# option src_ip 192.168.45.2
|
|
|
|
# option src_mac 00:11:22:33:44:55
|
|
|
|
# option src_port 1024
|
|
|
|
# option src_dport 80
|
|
|
|
# option dest_ip 194.25.2.129
|
|
|
|
# option dest_port 120
|
|
|
|
# option proto tcp
|