2008-08-04 19:51:58 +08:00
|
|
|
config defaults
|
|
|
|
option syn_flood 1
|
2008-09-29 00:17:49 +08:00
|
|
|
option input ACCEPT
|
2012-04-22 03:42:28 +08:00
|
|
|
option output ACCEPT
|
2008-09-24 23:10:16 +08:00
|
|
|
option forward REJECT
|
2010-05-19 17:49:21 +08:00
|
|
|
# Uncomment this line to disable ipv6 rules
|
|
|
|
# option disable_ipv6 1
|
2008-08-04 19:51:58 +08:00
|
|
|
|
|
|
|
config zone
|
|
|
|
option name lan
|
2011-06-30 09:31:23 +08:00
|
|
|
option network 'lan'
|
2012-04-22 03:42:28 +08:00
|
|
|
option input ACCEPT
|
|
|
|
option output ACCEPT
|
2011-06-30 09:31:23 +08:00
|
|
|
option forward REJECT
|
2008-08-04 19:51:58 +08:00
|
|
|
|
|
|
|
config zone
|
|
|
|
option name wan
|
2011-06-30 09:31:23 +08:00
|
|
|
option network 'wan'
|
|
|
|
option input REJECT
|
2012-04-22 03:42:28 +08:00
|
|
|
option output ACCEPT
|
2011-06-30 09:31:23 +08:00
|
|
|
option forward REJECT
|
2012-04-22 03:42:28 +08:00
|
|
|
option masq 1
|
2011-06-30 09:31:23 +08:00
|
|
|
option mtu_fix 1
|
2008-08-04 19:51:58 +08:00
|
|
|
|
2012-04-22 03:42:28 +08:00
|
|
|
config forwarding
|
|
|
|
option src lan
|
|
|
|
option dest wan
|
2009-01-01 03:02:03 +08:00
|
|
|
|
2009-08-13 11:31:53 +08:00
|
|
|
# We need to accept udp packets on port 68,
|
|
|
|
# see https://dev.openwrt.org/ticket/4108
|
|
|
|
config rule
|
2011-12-20 09:10:15 +08:00
|
|
|
option name Allow-DHCP-Renew
|
2009-08-13 11:31:53 +08:00
|
|
|
option src wan
|
|
|
|
option proto udp
|
|
|
|
option dest_port 68
|
|
|
|
option target ACCEPT
|
2011-06-30 09:31:23 +08:00
|
|
|
option family ipv4
|
|
|
|
|
|
|
|
# Allow IPv4 ping
|
|
|
|
config rule
|
2011-12-20 09:10:15 +08:00
|
|
|
option name Allow-Ping
|
2011-06-30 09:31:23 +08:00
|
|
|
option src wan
|
|
|
|
option proto icmp
|
|
|
|
option icmp_type echo-request
|
|
|
|
option family ipv4
|
|
|
|
option target ACCEPT
|
|
|
|
|
2011-11-09 19:10:37 +08:00
|
|
|
# Allow DHCPv6 replies
|
|
|
|
# see https://dev.openwrt.org/ticket/10381
|
|
|
|
config rule
|
2011-12-20 09:10:15 +08:00
|
|
|
option name Allow-DHCPv6
|
2011-11-09 19:10:37 +08: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 09:31:23 +08:00
|
|
|
# Allow essential incoming IPv6 ICMP traffic
|
2011-08-14 08:33:29 +08:00
|
|
|
config rule
|
2011-12-20 09:10:15 +08:00
|
|
|
option name Allow-ICMPv6-Input
|
2011-08-14 08:33:29 +08:00
|
|
|
option src wan
|
|
|
|
option proto icmp
|
|
|
|
list icmp_type echo-request
|
2012-02-26 05:00:23 +08:00
|
|
|
list icmp_type echo-reply
|
2011-08-14 08:33:29 +08: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
|
2012-06-08 22:20:34 +08:00
|
|
|
list icmp_type router-advertisement
|
|
|
|
list icmp_type neighbour-advertisement
|
2011-08-14 08:33:29 +08:00
|
|
|
option limit 1000/sec
|
|
|
|
option family ipv6
|
|
|
|
option target ACCEPT
|
|
|
|
|
|
|
|
# Allow essential forwarded IPv6 ICMP traffic
|
2012-04-22 03:42:28 +08:00
|
|
|
config rule
|
2011-12-20 09:10:15 +08:00
|
|
|
option name Allow-ICMPv6-Forward
|
2011-06-30 09:31:23 +08:00
|
|
|
option src wan
|
|
|
|
option dest *
|
|
|
|
option proto icmp
|
|
|
|
list icmp_type echo-request
|
2012-02-26 05:00:23 +08:00
|
|
|
list icmp_type echo-reply
|
2011-06-30 09:31:23 +08:00
|
|
|
list icmp_type destination-unreachable
|
|
|
|
list icmp_type packet-too-big
|
|
|
|
list icmp_type time-exceeded
|
2011-06-30 20:22:05 +08:00
|
|
|
list icmp_type bad-header
|
|
|
|
list icmp_type unknown-header-type
|
2011-06-30 09:31:23 +08:00
|
|
|
option limit 1000/sec
|
|
|
|
option family ipv6
|
|
|
|
option target ACCEPT
|
2009-08-13 11:31:53 +08:00
|
|
|
|
2013-01-04 23:59:28 +08:00
|
|
|
# Block ULA-traffic from leaking out
|
|
|
|
config rule
|
|
|
|
option name Enforce-ULA-Border-Src
|
|
|
|
option src *
|
|
|
|
option dest wan
|
|
|
|
option proto all
|
|
|
|
option src_ip fc00::/7
|
|
|
|
option family ipv6
|
|
|
|
option target REJECT
|
|
|
|
|
|
|
|
config rule
|
|
|
|
option name Enforce-ULA-Border-Dest
|
|
|
|
option src *
|
|
|
|
option dest wan
|
|
|
|
option proto all
|
|
|
|
option dest_ip fc00::/7
|
|
|
|
option family ipv6
|
|
|
|
option target REJECT
|
|
|
|
|
2009-04-13 06:38:34 +08:00
|
|
|
# include a file with users custom iptables rules
|
|
|
|
config include
|
|
|
|
option path /etc/firewall.user
|
|
|
|
|
2008-08-04 19:51:58 +08: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-22 03:42:28 +08:00
|
|
|
# option target REJECT
|
2008-08-04 19:51:58 +08:00
|
|
|
|
|
|
|
# block a specific mac on wan
|
|
|
|
#config rule
|
|
|
|
# option dest wan
|
|
|
|
# option src_mac 00:11:22:33:44:66
|
2012-04-22 03:42:28 +08:00
|
|
|
# option target REJECT
|
2008-08-04 19:51:58 +08: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-22 03:42:28 +08:00
|
|
|
# option dest_port 80
|
2008-08-26 15:23:29 +08:00
|
|
|
# option proto tcp
|
2008-08-04 19:51:58 +08:00
|
|
|
|
2011-05-02 20:54:31 +08: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 19:51:58 +08: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-22 03:42:28 +08:00
|
|
|
# option target REJECT
|
2008-08-04 19:51:58 +08: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
|