LinuxQuestions.org
Visit the LQ Articles and Editorials section
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 11-23-2008, 09:38 PM   #1
Vinnie-NZ
LQ Newbie
 
Registered: Nov 2008
Posts: 1

Rep: Reputation: 0
IPTables ext access to service that only accepts localhost


I'm running IPTables and a particular service on a server and I have a wish to do something a bit odd.

I've got a service on this machine that will only accept connections if coming from the localhost. I don't want to change this at all.

What I do want is, on occasion, to be able to access this particular service from the outside on a non standard port. I've already setup the ACCEPT rule so that the connection comes in on the non standard port and terminates on the correct one, and the logs reflect that I'm getting a connection.

Is there anyway I can get the external IP address to appear to this service as though its coming from the localhost through IPTables?
 
Old 11-23-2008, 09:49 PM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,094
Blog Entries: 2

Rep: Reputation: 111Reputation: 111
You might be able to use a SNAT rule in iptables to re-write the source to look like its from localhost. Outside of iptables you could use a simple socat or netcat to bridge the two things. Or you could even just use SSH and do a port forward on it like ssh -L port:127.0.0.1ort user@ip and then connect locally to that port and ssh will make it connect to the service from localhost.
 
  


Reply

Tags
iptables


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
Bind Iptables can't access out of localhost wspivak Linux - Server 4 03-26-2008 08:28 PM
iptables - problem whit lan access to apache and ftp service Ronin_tekorei Linux - Networking 5 01-17-2008 05:21 PM
[IPTABLES] open ext access to web server on GW server kozaki Linux - Networking 3 08-27-2005 05:11 PM
EXT 3 ... access in windoze mailavj Linux - Software 6 05-28-2005 03:14 AM
Iptables-- ext ip? Half_Elf Linux - Security 8 06-02-2002 02:51 AM


All times are GMT -5. The time now is 12:37 AM.

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