LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 05-09-2007, 10:04 AM   #1
odedm
LQ Newbie
 
Registered: May 2007
Posts: 4

Rep: Reputation: 0
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.

Last edited by odedm; 05-09-2007 at 11:45 AM.
 
Old 05-09-2007, 12:38 PM   #2
odedm
LQ Newbie
 
Registered: May 2007
Posts: 4

Original Poster
Rep: Reputation: 0
well problem solved...
add:
iptables -t nat -A POSTROUTING -s sourceip -d destip -j MASQUERADE

and now it's working

thanks.

bye bye.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
iptables help / howto ;) gbkyle Linux - Networking 1 07-18-2005 03:43 PM
iptables HOWTO? microsoft/linux Linux - Networking 4 04-11-2005 12:05 PM
Basic iptables howto??? PeaceTank Linux - Security 2 03-23-2005 02:30 AM
?howto iptables ping pudhiyavan Linux - Networking 10 12-09-2003 11:37 AM
iptables howto spank Linux - Newbie 3 12-01-2003 08:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:47 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration