LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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-09-2004, 05:21 PM   #1
carrellc
LQ Newbie
 
Registered: Mar 2004
Posts: 6

Rep: Reputation: 0
Reverse IP forwarding Help!! :)


Help !! - Reverse IP forwarding ( post #1)

Hi!
I've been searching everywhere for my answer and am needing help!

I'll give a quick overview of how our RH9 Linux server is setup and what i need help with:

We have a Mail/DNS/Internet server with 2 Nics in it eth0 and eth1. I've aliased eth1 with another address 199.x.x.26 and have made made the change in rc.firewall to forward all port 80 stuff from 199.x.x.26 to a computer on our lan 10.6.0.130

My problem is what do i do to make another local computer[say computer 10.6.0.99] that hits the address 199.x.x.26 redirect to 10.6.0.130, they can hit it by typing 10.6.0.130 as the url address but i want it to hit 199.x.x.26 for everyone nomatter where they are at home or at work.

I am guessing i have to modify DNS or use the route or NAT commands but i really need help on this one, first time i've ever had to do this and i've looked at tons of online docs/howtos but cannot find the same problem on the net, probly cause i am using the wrong keywords in refining my search

Appreciate all help i can get!!
Clint
 
Old 03-10-2004, 03:28 AM   #2
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
i think u can do that with iptables.. redirect to 10.6.0.136 if the sorce ip is from your local network (10.6.0.0/24), and destination ip is 199.0.0.26 and protocol is tcp and destination port is 80

all of them in a one line:
iptables -t nat -A PREROUTING -s 10.6.0.0/24 -p tcp --dport 80 -d 199.0.0.26 -j REDIRECT --to 10.6.0.136

i hope it works.. if it works let me know please
 
Old 03-11-2004, 02:16 AM   #3
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
im so sorry .. REDIRECT wont work.. u should use DNAT not REDIRECT..
 
Old 03-11-2004, 02:26 AM   #4
maxut
Senior Member
 
Registered: May 2003
Location: istanbul
Distribution: debian - redhat - others
Posts: 1,188

Rep: Reputation: 50
actually u must create another network segment for your server or servers (DMZ)..
and your clients must not be in same network with servers.. linux must be placed between local network, DMZ and internet.. if u do that u can configure everything easyly with iptables.
 
  


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
Mail Forwarding in postfix/maildrop/redhat (like yahoo mail forwarding) topcat Linux - Software 1 08-31-2007 01:10 PM
IPCHAINS port forwarding and IPTABLES port forwarding ediestajr Linux - Networking 26 01-14-2007 08:35 PM
Simple Port Forwarding Firewall - not forwarding MadTurki Linux - Security 14 04-09-2006 01:08 PM
Help:) !! - Reverse IP forwarding carrellc Linux - Wireless Networking 1 03-09-2004 05:19 PM
port forwarding and packet forwarding syrtsardo Linux - Newbie 2 07-03-2003 11:37 AM

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

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