Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 12-01-2004, 01:51 AM   #1
LQ Newbie
Registered: Dec 2004
Posts: 20

Rep: Reputation: 0
Possible or Impossible to do in Linux?

Situation: Linux router sitting between a cable modem and a local network. Three different IPs are assigned to the modem. The local network has multiple machines, one of which provides (at bare minimum) HTTP and FTP, and another that simply provides FTP.

What I need to have happen is the router routes traffic to different machines depending on the destination IP address; goes to Box A, goes to Box B, etc. This needs to happen with at least FTP protocol, preferably any protocol (HTTP, SSH, etc)

The router would also act as a DNS nameserver, handling both internal and external requests. External requests for domain names, internal requests so that the local network can talk to various parts of itself.

Can this be done? Can the Linux machine route FTP traffic from to Machine A at the same time as routing FTP traffic from to Machine B, while also allowing Machine C talk to Machine A and Machine B via FTP, SSH, HTTP, whatever?

If this is possible, what Linux distribution would be best suited for this type of massive undertaking?
Old 12-01-2004, 04:13 AM   #2
Registered: Mar 2004
Distribution: Slackware current, DSL 0.9.2
Posts: 133

Rep: Reputation: 15
short answer: No, I think.
First, when you say that three IPs are assigned to the cable modem, that means that three IP addresses point to the cable modem. It doesnt mean that three IPs are passed through the modem. When the data gets to the modem, the modem doesnt care about hostnames, it just sends it out to the one device it can connect to: your linux router. With the router you'd have to enable port forwarding and a sort of NAT (Look up IP masquerading). The only thing you could do is have different ports forwarded to different computers. IE:
Box A -> your.ip.of.cmodem -> linux router (which port?)^-->

Box B -> your.ip.of.cmodem -> linux router(which port?) ^ -->

Box C -> your.ip.of.cmodem -> linux router(which port?)^ -->

Notice that the external ports are not dependant on the services, but you must specify the port if your not using the default port for a known service. So if I wanted to access Box A's ftp service I would do "ftp" but if I wanted to access Box B's ftp service I would have to do "ftp". ftp is the equivalent of ftp, but since the port of ftp is well established as 21, it is not needed.

Box C will still be able to access box A and B's services, but only through the local ip's. Servers seem to have a problem sending data back to themselves. This can be achieved by adding entries into the hosts file for each computer :
That would be the hosts file for Box C so that you could still use the name to access the service. So in short, the reason that you cannot do the whole dns thing you're trying to do, is because of NAT.

Last edited by |2ainman; 12-01-2004 at 04:18 AM.
Old 12-12-2004, 01:38 AM   #3
Senior Member
Registered: Nov 2004
Location: Third rock from the Sun
Distribution: NetBSD-2, FreeBSD-5.4, OpenBSD-3.[67], RHEL[34], OSX 10.4.1
Posts: 1,197

Rep: Reputation: 47

Assuming the IPs are public addresses, certainly possible. It may be easiest to put the three servers up with their public IPs and just have the router box do a bridge between the servers and the internet, and filter the traffic accordingly.

This would *probably* land DNS on one of the three servers and not on the router, but that's ok as it belongs there anyway.

If you only have one internet routable IP, you're going to have a lot more trouble doing this, and you'll have to resort to some kind of PAT situation, or a reverse proxy kind of thing.

As for the distro to use -- I put OpenBSD (which is *not* linux, if that matters to you) on anything that is responsible for security. Just makes sense. It's got everything you could ever need to do routing and it's nice and small and trim too.
Old 12-13-2004, 12:12 AM   #4
Registered: Oct 2003
Distribution: Slackware
Posts: 101

Rep: Reputation: 15
Check out M0n0 Wall. I think it will do what you need right out of the box. M0n0wall is based on FreeBSD but what you want could still be done in linux, but why reinvent the wheel?


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
impossible to instal linux 9.0 Gyurka Linux - Newbie 9 10-09-2005 10:43 AM
installing software is impossible with linux... M O L8ingN2dust Linux - Newbie 10 05-25-2005 01:19 AM
Linux+ exam is really THIS impossible? susanf Linux - Certification 5 03-15-2005 04:36 PM
Impossible to boot Linux overnight Nightfrost Linux - General 4 06-17-2004 08:21 AM
Need for Speed ..... impossible with Linux ashesh Linux - General 7 06-22-2003 01:54 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 02:51 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration