LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 03-11-2005, 02:58 AM   #1
maenho
Member
 
Registered: Nov 2003
Location: Belgium
Posts: 81

Rep: Reputation: 15
route locally generated traffic to ip:port to localhost:port


Hi,

For reasons to complex to explain I would like that if a local application requests for example to connect to www.google.be:80 it actually connects to 127.0.0.1:80 (or different port). How would I do this?
 
Old 03-11-2005, 04:03 AM   #2
masand
Guru
 
Registered: May 2003
Location: INDIA
Distribution: Ubuntu, Solaris,CentOS
Posts: 5,522

Rep: Reputation: 58
u need to resolve the DNS locally i think
 
Old 03-11-2005, 04:08 AM   #3
ivanatora
Member
 
Registered: Sep 2003
Location: Bulgaria
Distribution: Ubuntu 9.10, FreeBSD 7.2
Posts: 459

Rep: Reputation: 31
You can use iptables and the OUTPUT chain and nat to redirect the request:
iptables -t nat -A OUTPUT -m tcp -p tcp -d 11.11.11.11 --dport 80 -j DNAT --to-destination 127.0.0.1:80
 
  


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
Is it not possible to route incomming port to another external port? ziggie216 Linux - Software 5 12-03-2005 06:16 PM
Port 25: No route to host dhruv Linux - Networking 4 04-07-2004 08:23 AM
Port 25: No route to host dhruv Linux - Newbie 0 04-03-2004 09:37 AM
ProFTPd - can connect locally but...Could it be that Verizon DSL does not allow port cevjr Linux - Networking 5 02-22-2004 04:42 PM
localhost:port sodhilogin Linux - General 7 05-14-2003 07:20 AM


All times are GMT -5. The time now is 11:03 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration