LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-17-2011, 11:25 AM   #1
n8felton
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Rep: Reputation: 0
Looking for some help with port redirection


Alright, so I'm have a base level understand of linux at this point but I'm trying to learn it some more, so I'm asking for some generous hand holding for this one.

I have Debian box that I am trying to do some port redirection with.

I have my external NIC as eth0 with an IP of x.x.250.5.
I have my internal NIC as eth1 with an IP of 192.168.1.1.

On the internal network I have a NAS box with a web interface at 192.168.1.100.

What I need is to set it up so that a request to x.x.250.5:8080 will some how forward/redirect to the internal network NAS box at 192.168.1.100:80.

Thanks in advance for any help you might provide.
 
Old 01-17-2011, 12:42 PM   #2
xanthaos
LQ Newbie
 
Registered: Jan 2010
Posts: 7

Rep: Reputation: 1
I am just reading through this post, and I need a better understanding of your architecture and topology. The debian box you are attempting to do redirection with, are you using it at the frontend of your network as a routing device, or do you simply have a secondary network behind this machine? If you have a secondary network behind this machine, is it being dhcp served by either a router or debian software dhcp server? I will do my best to help you here, I am more a Fedora guy but this sounds more a networking problem than distro specific. I await your reply...
 
Old 01-17-2011, 01:06 PM   #3
n8felton
LQ Newbie
 
Registered: Oct 2010
Posts: 2

Original Poster
Rep: Reputation: 0
more info

The Debian box is simply a server on the primary network with a secondary network behind it. The secondary network does not have a DHCP server. The NAS box has a staticly set IP address of 192.168.1.100 and is connected to the Debian box on eth1(192.168.1.1) via a crossover cable.

Hope this helps. Thanks!
 
Old 01-17-2011, 05:47 PM   #4
xanthaos
LQ Newbie
 
Registered: Jan 2010
Posts: 7

Rep: Reputation: 1
As long as both the NAS box and eth1 on the debian box are statically set, you should be okay. Statically set the DNS on the NAS box and on the debian eth1 device. On the NAS box, list the debian eth1 as the gateway. Also make sure that they both share the same subnet mask and are in the same network. If your mask is 255.255.255.0 then you should be okay. That's the easy parts...

Next you will deal with ip forwarding and routing tables. First, in your firewall which I believe is iptables (or it is in Fedora), make sure there is a forwarding rule to allow traffic between the two networks. Next examine your routing tables in the debian machine. The route or ip route command should get you the information you need. You will need to add a route to the NAS machine through eth1.

Are you wishing to share files from the NAS to the internet via a web portal? If so, and you are wanting to use the debian box as a NAT to obscure the address, you may wish to establish a bridge between the devices and masquerade the IP of eth1, establishing NAT on the debian box for that eth device only. By bridging the devices, the two networks are able to talk to each other, and by establishing masquerading, you can obscure the addresses of the devices behind the interface.

Do you have a router? If so what kind? You may find it easier to configure this setup with the NAS box running from the router as a peer on the switchport, unless you have a specific need to put the NAS into a completely different network than the primary network. Either way, bridging or otherwise, the routing tables in the debian box will need to reflect the forwarding from the x.x network to the 192.168 network.

Bear in mind if this is being accessed from the web, getting through one network to another may be a difficult process. You will need to specify a list of port forwards, first in your frontend router, then in the debian box, to forward the traffic through the debian box.

In your current situation, make sure that you have a static route in the primary router for the 192.168 network using the debian box as the gateway. By doing this, the debian box will receive the traffic and apply the correct routing and forwarding rules. Reply and let me know which method you choose and I will attempt to help you as much as I can.
 
  


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
when do we do port redirection? your_shadow03 Linux - Newbie 2 02-10-2010 01:26 AM
Need help with Cisco port redirection / port triggering kool_kid Linux - Networking 0 08-06-2009 02:25 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
port redirection for squid htm Linux - Software 0 03-20-2004 08:59 AM

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

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