openwrt/package/firewall/files
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
..
bin 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
lib firewall: allow local redirection of ports 2011-04-12 20:03:59 +00:00
firewall.config firewall: don't apply default udp/68 rule to ip6tables 2010-05-19 21:37:12 +00:00
firewall.hotplug firewall: run ifdown hotplug events synchronized, fixes a racecondition on "ifup iface" when ifdown and ifup events are delivered with a small dealy 2010-09-15 01:53:36 +00:00
firewall.init firewall (#7355) - 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 2010-05-19 00:50:14 +00:00
firewall.upgrade Keep firewall.user during sysupgrades 2011-03-20 00:57:47 +00:00
firewall.user firewall: enable /etc/firewall.user by default and install sample firewall.user file 2009-04-12 22:38:34 +00:00
reflection.hotplug firewall: also establish forward rules when setting up nat reflection, back out early if reflection is disabled 2010-10-03 18:11:59 +00:00