summaryrefslogtreecommitdiffstats
path: root/package/firewall
Commit message (Collapse)AuthorAgeFilesLines
* firewall: allow local redirection of portsjow2011-04-121-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allow a redirect like: config redirect option src 'wan' option dest 'lan' option src_dport '22001' option dest_port '22' option proto 'tcp' note the absence of the "dest_ip" field, meaning to terminate the connection on the firewall itself. This patch makes three changes: (1) moves the conntrack module into the conntrack package (but not any of the conntrack_* helpers). (2) fixes a bug where the wrong table is used when the "dest_ip" field is absent. (3) accepts incoming connections on the destination port on the input_ZONE table, but only for DNATted connections. In the above example, ssh -p 22 root@myrouter would fail from the outside, but: ssh -p 22001 root@myrouter would succeed. This is handy if: (1) you want to avoid ssh probes on your router, or (2) you want to redirect incoming connections on port 22 to some machine inside your firewall, but still want to allow firewall access from outside. Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26617 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: prevent duplicate values in interface state varsjow2011-03-302-2/+5
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26382 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Keep firewall.user during sysupgradesthepeople2011-03-202-0/+3
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26241 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: move include sourcing into a subshell, this makes the ↵jow2011-03-022-3/+5
| | | | | | firewall init immune against exit in the include scripts git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25835 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: fix rule generation for v4 or v6 only zones (#8955)jow2011-03-012-2/+5
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25813 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: fix wrong rule order if multiple protocols are usedjow2011-01-272-4/+4
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@25179 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: insert SNAT and DNAT rules according to the order of the ↵jow2010-10-083-3/+6
| | | | | | configuration file (#8052) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23318 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: mark /etc/firewall.user as conffilejow2010-10-051-0/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23231 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: also establish forward rules when setting up nat ↵jow2010-10-032-7/+16
| | | | | | reflection, back out early if reflection is disabled git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23201 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] add maintainer informationjow2010-09-301-0/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23159 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: fix chain selection logic, option dest must be ignored ↵jow2010-09-281-6/+5
| | | | | | for notrack targets git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23143 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: don't setup nat reflection if negations are usedjow2010-09-281-0/+3
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23142 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] fireall:jow2010-09-285-28/+42
| | | | | | | | - support negations for src_ip, dest_ip, src_dip options in rules and redirects - add NOTRACK target to rule sections, allows to define fine grained notrack rules git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23141 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: protect iptables invocations with locks in interface ↵jow2010-09-192-1/+5
| | | | | | ops, it might run concurrently due to hotplug invocations on network restart git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23090 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: make invalid redirects and duplicate zones non-fatal, ↵jow2010-09-164-10/+12
| | | | | | print a notice and discard them git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23080 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: run ifdown hotplug events synchronized, fixes a ↵jow2010-09-153-10/+8
| | | | | | racecondition on "ifup iface" when ifdown and ifup events are delivered with a small dealy git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23064 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: deliver remove hotplug events for all active ↵jow2010-09-143-3/+42
| | | | | | zones/networks when restarting the firewall git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23062 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall:jow2010-09-117-94/+114
| | | | | | | | | | - simplify masquerade rule setup - remove various subshell invocations - speedup fw() by not relying on xargs and pipes - rework SNAT support - attach to dest zone, use src_dip/src_dport as snat source git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23024 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall:jow2010-09-052-4/+6
| | | | | | | | - fix possible endless loop when the family option is used for forwardings - only generate forwarding rules in SNAT redirect sections if src_dip is specified git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22938 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: introduce SNAT support for redirect sectionsjow2010-09-053-4/+19
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22937 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: add option to disable NAT reflectionjow2010-09-041-0/+4
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22908 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: clean up description (#7875)jow2010-09-041-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22905 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall:jow2010-09-044-8/+33
| | | | | | | | - handle NAT reflection in firewall hotplug, solves synchronizing issues on boot - introduce masq_src and masq_dest options to limit zone masq to specific ip ranges, supports multiple subnets and negation git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22888 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall:jow2010-08-314-42/+63
| | | | | | | | | - fix processing of rules with an ip family option - append interface rules at the end of internal zone chains, simplifies injecting user or addon rules - support simple file logging (option log + option log_limit per zone) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22847 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firwall: fix nat reflection for zones covering multiple networksjow2010-07-311-34/+56
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22442 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: add basic NAT reflection/NAT loopback supportjow2010-07-312-1/+81
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22441 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: allow redirecting only destination port (#7197)jow2010-07-162-3/+4
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22227 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: fix another notrack related bugjow2010-07-151-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22218 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall:jow2010-07-155-9/+11
| | | | | | | | - notrack support was broken in multiple ways, fix it - also consider a zone conntracked if any redirect references it (#7196) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@22215 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall:jow2010-06-021-10/+23
| | | | | | | | - support alias ifnames different from parent ifname - properly handle multiple subnets per alias (v4+v6) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21656 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: Initial alias interface support. This allows to define ↵jow2010-06-013-29/+86
| | | | | | zones covering alias interfaces and associated entries like rules and forwardings. git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21653 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: change the order of IPv4/IPv6 address detection, fixes ↵jow2010-05-312-2/+2
| | | | | | mixed notation v6 improperly detected as v4 address git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21642 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: fix support for netranges in redirect and rule sectionsjow2010-05-304-8/+8
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21640 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: count rules per chain and family, fix wrong order of ↵jow2010-05-221-4/+4
| | | | | | ip6tables rules when ipv4 only or dual family rules are defined git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21533 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: don't apply default udp/68 rule to ip6tablesjow2010-05-191-0/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21509 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall:jow2010-05-197-41/+105
| | | | | | | | - fix ip6tables rules when icmp_type option is set - add "family" option to zones, forwardings, redirects and rules to selectively apply rules to iptables and/or ip6tables git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21508 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: add commented disable_ipv6 option to default configjow2010-05-191-0/+2
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21505 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: implement disable_ipv6 uci optionjow2010-05-192-5/+11
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21503 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall (#7355)jow2010-05-195-27/+12
| | | | | | | | | | | | | | - partially revert r21486, start firewall on init again - skip iface hotplug events if base fw is not up yet - get ifname and up state with uci_get_state() in iface setup since the values gathered by scan_interfaces() may be outdated when iface coldplugging happens (observed with pptp) - ignore up state when bringing down interfaces because ifdown reverts state vars before dispatching the iface event - bump package revision git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21502 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: fix a possible deadlock when the firewall config has ↵jow2010-05-181-2/+4
| | | | | | syntax errors during restart git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21501 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: use uci_get_state() wrapperjow2010-05-171-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21493 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: properly clear hooks in fw_stop() to prevent extensions ↵jow2010-05-171-1/+8
| | | | | | from being called twice after fw_restart() git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21488 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall:jow2010-05-174-7/+21
| | | | | | | | | | | - defer firewall start until the first interface is brought up by hotplug, fixes race conditions on slow devices - create a file lock during firewall start and wait for it in hotplug events, prevents race conditions between start and addif - start firewall actions in background from hotplug handler since the firewall itself fires further hotplug events which results in a deadlock if not forked off - get loaded state direcly from the uci binary since updated value is not recognized by config_get after uci_set_state - bump package revision to r2 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21486 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: properly unset position for delete command, fixes rule ↵jow2010-05-051-2/+2
| | | | | | removal in ifdown git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21378 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: fix bug in iface hotplug handlerjow2010-05-051-1/+1
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21360 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall:jow2010-05-0115-544/+1023
| | | | | | | | - replace uci firewall with a modular dual stack implementation developed by Malte S. Stretz - bump version to 2 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21286 3c298f89-4303-0410-b956-a3cf2f4a3e73
* allow pingthepeople2010-03-181-0/+7
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@20261 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: insert rules at the beginning of chains again while ↵jow2010-03-021-1/+4
| | | | | | maintaining non reversed order, fixes wrong ordering introduced by r18015 git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19946 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: fix bad number error in fw_redirect() (#6704)jow2010-02-201-3/+3
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19765 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Add destination ip of the wan adapter useful if you have multiple ip addresses.thepeople2010-02-111-0/+2
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19574 3c298f89-4303-0410-b956-a3cf2f4a3e73