fwtools
Tools that help make quick changes to iptables rulesets.
Synopsis
fwbypass { enable | disable } ip
portfwd { enable | disable } port ip [ dstport ]
Description
fwbypass provides and easy way of temporarily allowing uncrestricted access through the firewall for ip by injecting the appropriate rules into the running iptables ruleset (specifically, the FORWARD chain). These changes are lost if the ruleset is reloaded. Subsequently, the access can be removed by specifying disable instead of enable.
portfwd adds the appropriate rules into the running uptables ruleset to forward inbound connections to the TCP port port to IP address ip. Optionally, a different destination port (dstport) can be specified. Subsequently, specifying disable rather than enable will cause portfwd to remove the rules instead.
Options
fwbypass
enableAdd the appropriate rules foripto the running ruleset.disableRemove the appropriate rules foripfrom the running ruleset.ipThe IP address that should have the access granted/revoked.
portfwd
enableAdd the appropriate rules to setup the port forward.disableRemove the appropriate rules to stop the port forward.portThe port number to listen for connections on.ipThe IP address to forward connections to.dstportThe optional destination port (if different fromport).
Caveats
fwbypass
When removing rules for ip, any rules that match those generated by fwbypass will be removed as well.
The rules generated by fwbypass are:
-A FORWARD -s (ip) -j ACCEPT
-A FORWARD -d (ip) -j ACCEPT
portfwd
When removing rules, any rules that match those generated by portfwd will be removed as well.
The rules generated by portfwd are:
-A INPUT -p tcp -m tcp --dport (port) -j ACCEPT
-A OUTPUT -p tcp -m tcp --sport (port) -j ACCEPT
-A FORWARD -p tcp -m tcp --dport (port) -j ACCEPT
-A FORWARD -p tcp -m tcp --sport (port) -j ACCEPT
-t nat -A PREROUTING -p tcp -m tcp --dport (port) -j DNAT --to-destination (ip)[:dstport]
Comments