Tech Support > Operating Systems > UNIX / Variants > iptables question
iptables question
Posted by Theo Vermeulen on June 27th, 2004


Hi group


I have got a problem.

I have a firewall (floppyfw 2.05) and it forwards all traffic to port 25 and
80 to a certain computer in my network. but since I have several computers
in the network, it gets sent to xxx.xxx.xx.100 .. so far there isn't a
problem. But due to some electrical problems, all the computers rebooted,
and the one that should get xxx.xxx.xx.100 is now 101, and I can't change it


Now, instead of rebooting all computers pointlessly, I would like to be able
to give a command-line to change the forward-address.

I don't know anything about networks, so please try to explain it not too
difficult.


Thanks

(excuse me for my not-so-good english)

--
Theo Vermeulen
this-email-address-is-real.admin@nospam.patat.org
^it_IS_^
#EOF

Posted by jpd on June 27th, 2004


On 2004-06-27, Theo Vermeulen
<this-email-address-is-real.admin@nospam.patat.org> wrote:
[snip: port forwarding to a dynamic address, and the address changed!!1!1!]
That would be in the floppyfw documentation. That is the canonnical
place to look it up. I suggest you do that, instead of asking others
to do it for you.

The better solution is to give that one particular machine a fixed IP.
You don't explain a thing about how the network is setup, so I can't
give hints on how to do that.


Hire someone to fix it for you?


--
j p d (at) d s b (dot) t u d e l f t (dot) n l .

Posted by Luke on July 29th, 2004


Theo Vermeulen wrote:

As the other poster suggested you need to set a static ip on your
firewall - having it on dhcp allocated address is gonna cause you a lot
of rule changing.


iptables -t nat -A PREROUTING -p tcp -s ! <FIREWALL_IP>/<SUBNET_MASK>
-i eth0 --dport 25 -j DNAT --to xxx.xxx.xx.101:25

iptables -t nat -A PREROUTING -p tcp -s ! <FIREWALL_IP>/<SUBNET_MASK>
-i eth0 --dport 80 -j DNAT --to xxx.xxx.xx.101:80

Cheers,
Luke