LinuxQuestions.org
Visit Jeremy's Blog.
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 01-27-2009, 12:00 AM   #1
naw_deepak
Member
 
Registered: Aug 2008
Posts: 35

Rep: Reputation: 15
Port redirection in Redhat Ent Linux5


Hi all,

I have a server on which nating is enabled. It has two ethernet eth0 and eth1. Eth0 is for external network and eth1 is for internal. My requirement is, the requests come from external network on port 21 should be redirected to port 10000. What is the iptable command should I use? or please guide me any way to make it possible.

Thanks in advance,
Deepak
 
Old 01-27-2009, 12:36 PM   #2
rossonieri#1
Member
 
Registered: Jun 2007
Posts: 359

Rep: Reputation: 34
hi,

Quote:
My requirement is, the requests come from external network on port 21 should be redirected to port 10000.
a little bit unclear,
there are 2 redirection mode in iptables :
using DNAT (can be in POSTROUTING & PREROUTING NAT table)
and or REDIRECT (just in PREROUTING NAT table).

so, to which NIC (external or internal) your external_port_21 traffic should be redirect?

DNAT :
iptables -t nat -I POSTROUTING -i external_NIC -p tcp --dport 21 -j DNAT --to-destination internal_serverort

REDIRECT :
iptables -t nat -I PREROUTING -i external_NIC -p tcp --dport 21 -j REDIRECT --to-port port

or $man iptables

Last edited by rossonieri#1; 01-27-2009 at 12:43 PM. Reason: forgot to give the example :)
 
  


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
Redhat Ent. VS Fedora gomisute Fedora 2 03-02-2008 02:48 AM
New to RedHat Ent. 5 Questions lstanderfer Linux - Enterprise 2 11-01-2007 10:28 AM
Redhat Ent. 4 registration sunhui Linux - Software 1 01-12-2007 05:29 AM
Port 80 redirection omlex Linux - Security 1 02-20-2005 03:22 PM
Port Redirection JonChristmas Linux - Networking 1 09-04-2004 03:19 AM

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

All times are GMT -5. The time now is 10:35 AM.

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