iptables: two simple questions

From: Reiner Griess (mynewnews@gmx.net)
Date: 01/31/02


From: mynewnews@gmx.net (Reiner Griess)
Date: 31 Jan 2002 21:08:52 GMT

Hi there,

I'm using OpenBSD as a firewall. No problems here. Now I want
to have the following three rules implemented in _iptables for linux_
(RH7.2).

1) rdr on <ftp_if> from any to <ftp_ip> port 21 -> <ext_ip> port 21

and

2) nat on <ftp_if> from <ext_ip> to any -> <ftp_ip>

and

3) rdr on <ftp_if> from any to <ftp_ip> port 49152 -> <ext_ip> port
   49152

I've tried this for number 1:

iptables -t nat -A PREROUTING -p tcp -i eth0 -s 0/0 -d 192.168.1.4
--dport 21 -j DNAT --to-destination 80.131.76.12:21

and this for number 2:

iptables -t nat -A POSTROUTING -p tcp -o eth0 -s 80.131.76.12 -d 0/0
-j MASQUERADE

and this for number 3:

iptables -t nat -A PREROUTING -p tcp -i eth0 -s 0/0 -d 192.168.10.4
--dport 49152 -j DNAT --to-destination 80.131.76.12:49152

It seems not to work....

iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination

Chain FORWARD (policy ACCEPT)
target prot opt source destination

Chain OUTPUT (policy ACCEPT)
target prot opt source destination

Any help out there?
Thanks
reiner



Relevant Pages

  • Re: Iptables not saving...
    ... Chain FORWARD (policy ACCEPT) ... Chain OUTPUT ... You want to direct its output to where iptables normally ...
    (Fedora)
  • Re: Iptables not saving...
    ... Chain FORWARD (policy ACCEPT) ... Chain OUTPUT ... You want to direct its output to where iptables normally ...
    (Fedora)
  • Re: some reality about iptables, please
    ... > That's the 'plumbing' level access to iptables which works for all Linux kernels supporting iptables, ... Chain POSTROUTING (policy DROP) ... DROPl all --!192.168.174.0/24 anywhere ...
    (Debian-User)
  • Re: iptables maybe??
    ... What does your routing table look like (the output of the route command). ... So the night before I shut my linux machine down. ... > Chain FORWARD (policy DROP) ...
    (alt.os.linux)
  • Re: IP Masquerading
    ... here's the first third of the iptables listing (I'll send more if ... Chain FORWARD (policy DROP) ... The windows boxes seem to be getting their ...
    (alt.os.linux.suse)