openwrtv3/package/firewall/files/lib
Jo-Philipp Wich a9977eca91 firewall: allow local redirection of ports
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>

SVN-Revision: 26617
2011-04-12 20:03:59 +00:00
..
config.sh firewall: change the order of IPv4/IPv6 address detection, fixes mixed notation v6 improperly detected as v4 address 2010-05-31 01:34:47 +00:00
core.sh firewall: make invalid redirects and duplicate zones non-fatal, print a notice and discard them 2010-09-16 11:47:35 +00:00
core_forwarding.sh firewall: - 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 2010-09-11 20:04:34 +00:00
core_init.sh firewall: move include sourcing into a subshell, this makes the firewall init immune against exit in the include scripts 2011-03-02 19:20:29 +00:00
core_interface.sh firewall: prevent duplicate values in interface state vars 2011-03-30 20:29:17 +00:00
core_redirect.sh firewall: allow local redirection of ports 2011-04-12 20:03:59 +00:00
core_rule.sh firewall: fix wrong rule order if multiple protocols are used 2011-01-27 22:19:53 +00:00
fw.sh fireall: - 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 2010-09-28 10:42:56 +00:00
uci_firewall.sh firewall: - replace uci firewall with a modular dual stack implementation developed by Malte S. Stretz - bump version to 2 2010-05-01 18:22:01 +00:00