LinuxQuestions.org
Visit Jeremy's Blog.
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 10-28-2005, 12:37 PM   #1
kimdenmark
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Rep: Reputation: 0
Forwarding domain to second linux box


Need advice on forwarding based on domainname.

I have a setup where i have 2 linux boxes.

BOX1:
NIC1: Public Static IP address
NIC2: Private IP 192.168.1.10

BOX2:
NIC1: Private IP 192.168.1.95

On box 1 i have some domainnames which are all hosted on that
machine, and works 100%

Now i want to have my new domain hosted on BOX2

So what i have tried to find information is how to forward
ALL requests (mail, ftp, www etc) comming to my new domain
through the public ip on BOX1 - to BOX2

An example.

domain1.net --> box1
domain2.net --> box1
(that works allready(

What i cant make work is :

domain3 --> box1 --> redirect --> box2

I have googled all day to no help

I hope someone can hep me :-)

Regards

Kim
 
Old 10-28-2005, 12:54 PM   #2
fouldsy
Senior Member
 
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284

Rep: Reputation: 47
Can you not just create another virtual host within apache on your first box that points through to your second box? I'm assuming that since they're all listening on the same external IP address, you have apache listening for the different incoming domain names. A new virtual host on your first machine can simply point to your second box, once apache and the website you require is already setup on your other box.
 
Old 10-28-2005, 12:58 PM   #3
kimdenmark
LQ Newbie
 
Registered: Oct 2005
Posts: 2

Original Poster
Rep: Reputation: 0
I thought about that as well, but as far as i could see, it would
be a WEB only - i would like one that covers ALL.

Web, mail, ftp etc...

Any suggestions recieved with great smile

Kim
 
Old 10-28-2005, 02:31 PM   #4
bdogg
Member
 
Registered: Sep 2004
Location: Salt Lake City, UT
Distribution: Debian Sarge
Posts: 93

Rep: Reputation: 15
squid has the ability to do all that

www.squid-cache.org

You can configure it to forward requests based on domain name, and then in the /etc/hosts file just put the box1 and box2 private ip addresses. Because squid checks that file first, it will forward requests to the private ip, rather than what a dns server out on the internet says. Then you would send both domains to the public ip address on box 1 and let squid sort them and send them to the private ip addresses hosted on the specific boxes. I do this now with just HTTP, but I know you can configure squid to forward all those ports (mail, ftp, etc)
 
Old 11-10-2005, 05:26 PM   #5
cohnhead
LQ Newbie
 
Registered: Nov 2005
Posts: 1

Rep: Reputation: 0
I have been searching for an answer to the same question (for the exact same reason) for several days.

kimdenmark - were you able to use squid to forward the second domain to a different internal ip address?

I found this post on the same topic as well, but unfortunately the conversation died after some flaming...
http://www.linuxquestions.org/questi...ain+forwarding

Is there any way to accomplish this using iptables?

Any help out there would be greatly appreciated!

-- Cohnhead
 
Old 11-10-2005, 05:56 PM   #6
fr_laz
Member
 
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384

Rep: Reputation: 32
hi

problem with iptables is that with basic config you'd need to have your 2 servers running on 2 different ports, cause it won't look inside the http packets to look at the name beeing used...
BUT, i saw a new target support in kernel 2.6.14: "string match support" is the name of the module as seen in make menuconfig, the option name is CONFIG_IP_NF_MATCH_STRING.
from the help:
This option adds a `string' match, which allows you to look for pattern matchings in packets.

so you should be able to use this to match the packets you want to forward and the ones you want to put in the incoming table...
i wont talk about performance, cause, as you may have found out, i never tried this target, but it is certainly not very efficient as string matching is far more complicated than looking to an ip address when you know at which bit in the packet is the begining and the end of this ip address.... but broadband is so slow compared to lan that it might work fine for a home user... i really dont know, but it's worth a try, i'd say.

good luck !
 
  


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
Linux box not able to join win 2000 domain jomy Linux - Networking 0 12-13-2004 02:59 AM
no internet connection on linux box but XP can logon to domain kenji1903 Linux - Networking 4 07-27-2004 09:02 PM
setting up linux box as domain controller samills70 Linux - Newbie 2 06-09-2004 03:51 AM
Win2k AD server because of very tight secuirty i can't make my linux box join domain keshif Linux - Networking 7 02-05-2004 02:04 AM
Newbie adding Linux box to W2k Domain. Help. jstamp Linux - Networking 2 09-10-2003 02:55 PM

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

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