LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 03-14-2006, 05:20 AM   #1
ad2005
LQ Newbie
 
Registered: Jan 2006
Posts: 5

Rep: Reputation: 0
Question port forwarding using IPTABLE ...( Help)


Hi everybod,

i have redhat 9, all my internet clinets connected to my server via port 10009 and some other ports , and i need to forword all clinets connected to port 10009 only to anther INTERNET ip address PORT 3999

is there any iptable rule can do this ?

waitting for reply
Thank you

Regards
AD

Last edited by ad2005; 03-14-2006 at 05:23 AM.
 
Old 03-14-2006, 05:31 AM   #2
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
IPTABLES -t nat -A PREROUTING -d $YOUR-SERVER-IP -p tcp --dport 10009 -j DNAT --to-destination $YOUR-INTERNET-IP-ADDRESS:3999
 
Old 03-14-2006, 05:35 AM   #3
ad2005
LQ Newbie
 
Registered: Jan 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Smile

Thank you amitsharma_26 for your kind reply

i will test it ..

Regards
AD
 
Old 03-14-2006, 07:44 AM   #4
ad2005
LQ Newbie
 
Registered: Jan 2006
Posts: 5

Original Poster
Rep: Reputation: 0
Unhappy

not working withe me

1) frist its dos not accepet the other server DNS ip address
the iptable give me Bad IP address `.no'
2) when i channge it to ip address numbers its accepted work but no connection happen fot both servers.


this the line i used

iptable -t nat -A PREROUTING -d $127.0.0.1 -p tcp --dport 10009 -j DNAT --to-destination $193.546.46.116:3999


do i have to put this in my router maby it solve the problem ??

and one more thing is this rule can be removed by iptabls -F




thanks

Regards
AD

Last edited by ad2005; 03-14-2006 at 07:49 AM.
 
Old 03-14-2006, 11:23 AM   #5
ad2005
LQ Newbie
 
Registered: Jan 2006
Posts: 5

Original Poster
Rep: Reputation: 0
eny idea ??
 
Old 03-15-2006, 10:56 PM   #6
amitsharma_26
Member
 
Registered: Sep 2005
Location: New delhi
Distribution: RHEL 3.0/4.0
Posts: 777

Rep: Reputation: 31
Remove the dollar ($) sign... & then run the command.

You can restart the IPTABLES service to flush everything.
 
  


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
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 07:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 12:08 PM
using iptable to close port instead of stopping services Emmanuel_uk Linux - Newbie 1 07-07-2005 03:54 AM
IPTable Problems (Port Forwarding)... Arch3Angel Linux - Security 3 12-04-2004 04:56 PM
Iptable-rules block port 80 goldenmag Linux - Security 3 09-05-2003 06:56 PM

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

All times are GMT -5. The time now is 08: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