LinuxQuestions.org
Review your favorite Linux distribution.
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 02-10-2005, 06:40 AM   #1
alaios
Senior Member
 
Registered: Jan 2003
Location: Aachen
Distribution: Opensuse 11.2 (nice and steady)
Posts: 2,203

Rep: Reputation: 45
change port using destination


Hi... Do u know if it is possible to change the port of some packets using iptables.? I want the decision to be based on the ip address..
Any suggestion?
 
Old 02-10-2005, 09:39 AM   #2
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
hi,

man iptables and search for SNAT, DNAT

ex :
iptables -t nat -A POSTROUTING -s 192.168.0.3 -p tcp --sport 80 -j SNAT --to-source 10.0.0.3:8080
iptables -t nat -A PREROUTING -d 10.0.0.3 -p tcp --dport 8080 -j DNAT --to-dest 192.168.0.3:80

You can have a look at http://www.linuxsecurity.com/resourc...-tutorial.html

Bye
 
Old 02-11-2005, 09:55 AM   #3
ugge
Senior Member
 
Registered: Dec 2000
Location: Gothenburg, SWEDEN
Distribution: OpenSUSE 10.3
Posts: 1,028

Rep: Reputation: 45
I you only want to change the port, then you can use the REDIRECT target.
 
Old 03-01-2005, 04:06 AM   #4
vipspark
LQ Newbie
 
Registered: Jan 2005
Location: New Delhi
Posts: 17

Rep: Reputation: 0
Hello all of you

But as u suggested to use iptables it will redirect the traffic of ftp port to another port BUT it still outer world will use the same port.

I dont know but is there any way to change the ftp port so that default ftp port will get changed.means to ftp some system user cant enter from port 21.

thanku
KeepsmilinG
 
  


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
PLESK [Solution] Change port to 23 (telnet) instead of default port 8443 x5452 Linux - Software 6 05-10-2009 05:58 AM
Change the destination URL by IPTABLES swmok Linux - Networking 4 09-14-2004 11:33 AM
Change Telnet Port acbenny Linux - Networking 2 07-22-2004 08:05 AM
--destination-ports port[,port[,port...]] KevinGuy Linux - Networking 1 03-16-2004 06:06 PM
IPTABLES --to-destination muliple ip:port hawk4eye Linux - Networking 4 02-07-2003 04:59 AM

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

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