summaryrefslogtreecommitdiffstats
path: root/package/firewall/files
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-301-1/+4
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@26382 3c298f89-4303-0410-b956-a3cf2f4a3e73
* Keep firewall.user during sysupgradesthepeople2011-03-201-0/+1
| | | | 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-021-2/+4
| | | | | | 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-011-0/+3
| | | | 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-271-3/+3
| | | | 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-082-2/+5
| | | | | | configuration file (#8052) git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23318 3c298f89-4303-0410-b956-a3cf2f4a3e73
* [package] firewall: also establish forward rules when setting up nat ↵jow2010-10-031-6/+15
| | | | | | reflection, back out early if reflection is disabled git-svn-id: svn://svn.openwrt.org/openwrt/trunk@23201 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-284-27/+41
| | | | | | | | - 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-191-0/+4
| | | | | | 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-163-9/+11
| | | | | | 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-152-9/+7
| | | | | | 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-142-2/+41
| | | | | | 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-116-93/+113
| | | | | | | | | | - 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-052-3/+18
| | | | 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:jow2010-09-043-6/+30
| | | | | | | | - 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-313-41/+62
| | | | | | | | | - 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-311-0/+79
| | | | 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-161-2/+3
| | | | 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-154-8/+10
| | | | | | | | - 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-012-28/+85
| | | | | | 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-303-7/+7
| | | | 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-196-40/+104
| | | | | | | | - 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-194-26/+11
| | | | | | | | | | | | | | - 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-173-6/+20
| | | | | | | | | | | - 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-0114-539/+1016
| | | | | | | | - 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
* [package] firewall: fix a race condition preventing interfaces from being ↵jow2010-01-191-2/+6
| | | | | | added to the firewall on boot git-svn-id: svn://svn.openwrt.org/openwrt/trunk@19232 3c298f89-4303-0410-b956-a3cf2f4a3e73
* firewall: fix fallout from r18716 (fixes #6338)nbd2009-12-101-1/+3
| | | | git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18733 3c298f89-4303-0410-b956-a3cf2f4a3e73
* firewall: get rid of recursive shell script inclusion to improve hush ↵nbd2009-12-092-37/+46
| | | | | | compatibility git-svn-id: svn://svn.openwrt.org/openwrt/trunk@18716 3c298f89-4303-0410-b956-a3cf2f4a3e73