Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-28-2005, 01:37 PM
|
#1
|
LQ Newbie
Registered: Oct 2005
Posts: 2
Rep:
|
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
|
|
|
10-28-2005, 01:54 PM
|
#2
|
Senior Member
Registered: Jan 2002
Location: St Louis, MO
Distribution: Ubuntu
Posts: 1,284
Rep:
|
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.
|
|
|
10-28-2005, 01:58 PM
|
#3
|
LQ Newbie
Registered: Oct 2005
Posts: 2
Original Poster
Rep:
|
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
|
|
|
10-28-2005, 03:31 PM
|
#4
|
Member
Registered: Sep 2004
Location: Salt Lake City, UT
Distribution: Debian Sarge
Posts: 93
Rep:
|
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)
|
|
|
11-10-2005, 06:26 PM
|
#5
|
LQ Newbie
Registered: Nov 2005
Posts: 1
Rep:
|
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
|
|
|
11-10-2005, 06:56 PM
|
#6
|
Member
Registered: Jan 2005
Location: Cork Ireland
Distribution: Debian
Posts: 384
Rep:
|
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 !
|
|
|
All times are GMT -5. The time now is 12:07 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|