Re: iptables port forwarding for specific source addresses



"ynotssor" <ynotssor@xxxxxxxxxxx> writes:

We're seeking help please with finding examples or tutorials on the
following, which must be quite common: we wish to accept connections from
external specific IP address ranges to a certain port on an internal
machine.

What syntax is required to allow a machine w.x.0.0/16 to connect to our
external iptables eth1 = a.b.c.126:8317 (e.g. "security by obscurity") and
be forwarded to 10.0.0.9:443 where other AUTH security checks exist, please?

The iptables firewall currently drops all but RELATED, ESTABLISHED on
external eth1 and logs all unsolicited packets (we have that under control,
thanks):

Something like:

iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 8317 -s w.x.0.0/16 -j DNAT --to-destination 10.0.0.9:443

You'll also need to do forwarding for eth1 and in the FORWARD table.

sysctl -w net.ipv4.conf.eth1.forwarding=1

I think you have the FORWARD table already policied to ACCEPT. If you
need UDP too, then one more rule like the above with -p udp will work.



--
Protect? [** America, The Police State **] Serve?
http://www.hermes-press.com/police_state.htm
http://www.theregister.co.uk/2008/01/27/bush_nsa_internal/
http://www.privacyinternational.org/article.shtml?cmd%5B347%5D=x-347-559597
http://www.homelandstupidity.us/2008/07/04/electric-shock-for-air-passengers/
http://www.presstv.ir/detail.aspx?id=65414&sectionid=3510203
Teen Tazered 19 times: http://www.ky3.com/news/local/26158674.html
Guns For TX Teachers: http://news.bbc.co.uk/1/hi/world/americas/7564654.stm
Castration Punishment: http://www.foxnews.com/story/0,2933,348171,00.html
.



Relevant Pages

  • Re: remote desktop listening port and drive porting
    ... Try also forwarding UDP 3390... ... or COM port redirection for the server machine whose listening port was ... etc. just the client's drives to not appear on the remote desktop ...
    (microsoft.public.windowsxp.work_remotely)
  • Re: Found Answer but new Q (was DNS Server Not Responding (Win 2003 SBE))
    ... > for port 53 under the TCP protocol, but not the UDP ... > 53 forwarding, and it still works. ... I thought DNS requests came in over TCP. ...
    (microsoft.public.win2000.dns)
  • Re: Problems with DNS on W2K (not responding to external)
    ... forwarding UDP for 53, and the server disappeared to me altogether. ... that are showing up in the event log (like zone transfers). ...
    (microsoft.public.win2000.dns)
  • Re: local nets
    ... > You will need to add some rules to the FORWARD table, to block TCP and UDP ... > forwarding between the two networks ... > - DROP all ICMP FORWARDED from SOURCE 192.168.1.0/24 to DEST ...
    (comp.os.linux.security)