LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   iptables howto (https://www.linuxquestions.org/questions/linux-networking-3/iptables-howto-552598/)

odedm 05-09-2007 09:04 AM

iptables howto
 
Hi,
I'm having problems with iptables.. I've never used iptables before, Please help... :)

I have 3 servers:


| Server A |-----| Server B |---------------------| WAN |-------------| Server C |




Server A have no connection to server C
Server B have connection to server C

I need all connections from server A to server B on port 3333 will be forwarded to server C on the same port.


I've tried to do this on server B:
iptables -t nat -A PREROUTING -s SERVER-A-IP -p tcp -m tcp --dport 3333 -j DNAT --to-destination SERVER-C-IP

and

echo 1 > /proc/sys/net/ipv4/ip_forward

And when I tested the connection from A to B on port 3333 i get network timeout..

Help please.
Oded.

odedm 05-09-2007 11:38 AM

well problem solved...
add:
iptables -t nat -A POSTROUTING -s sourceip -d destip -j MASQUERADE

and now it's working

thanks.

bye bye.


All times are GMT -5. The time now is 02:40 AM.