LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
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, 09: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 10:45 AM.
 
Old 05-09-2007, 11:38 AM   #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



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 02:43 PM
iptables HOWTO? microsoft/linux Linux - Networking 4 04-11-2005 11:05 AM
Basic iptables howto??? PeaceTank Linux - Security 2 03-23-2005 01:30 AM
?howto iptables ping pudhiyavan Linux - Networking 10 12-09-2003 10:37 AM
iptables howto spank Linux - Newbie 3 12-01-2003 07:34 AM

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

All times are GMT -5. The time now is 05:08 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
Open Source Consulting | Domain Registration