LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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
 
LinkBack Search this Thread
Old 05-22-2003, 05:22 PM   #1
AustinS
LQ Newbie
 
Registered: May 2003
Distribution: RH8
Posts: 2

Rep: Reputation: 0
Unhappy Rouing to Private IPs


Hi,

I'm interested in doing something similar to an LVS router.
I would like to have web requests come to a virtualserver with a public address. Instead of having them forwarded based on ip/port I would I like to route by domain name to a real server.

Reason: I'm running low on IPs and if LVS can route to private IPs their has to be some way of routing multiple domains from a single IP & Port to a Private IP farm.

Any Idea's are welcome.
And howto's are loved.

 
Old 05-23-2003, 09:51 AM   #2
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 46
what do you mean by "route my domain to a real server"..do you mean like if you domain is "mydomain.com" you want that to be a specific computer? Well if you have a private network, and you want anything that goes to "mydomain.com" to route to private IP 192.168.0.100, then you'd 1st have to make sure that "mydomain.com" 1st comes to the router (mydomain.com is just a name for some specific ip address) so the IP of the router has to match the DNS entry for mydomain.com.

Then on the router, you simply forward everything to the private computer. If its a linux box with iptables you could do this:

1. Assumptions: the domain name maps to IP 123.456.789.123

2. the rule:

iptables -A PREROUTING -d 123.456.789.123 -j DNAT -to 192.168.0.100

that forwards all requests headed for 123.456.789.123 to the private machine 192.168.0.100. You could also forward based on what is necessary. Like if the mydomain.com server only serves web pages, then you only need to forward port 80. If you want ssh, forward port 22, if its an ftp server, forward the ftp port and so on and so forth. You could even split up all these services amond different computers and forward accordingly and as far as the outside world is concerened....it all goes to 1 machine (because its all the same IP just different ports).
 
Old 05-23-2003, 02:06 PM   #3
AustinS
LQ Newbie
 
Registered: May 2003
Distribution: RH8
Posts: 2

Original Poster
Rep: Reputation: 0
This is almost what I want but I would like 123.456.789.012
to route www.xxx.zzz to 192.168.0.10 and
www.yyy.zzz to 192.168.0.11 when both come to 123.456.789.012 on port 80.

I did a little investigation last night on SQUID and a reverse or transparent proxy configuration.... my head will stop spinning eventually. It looks like it may be my solution. I'm a little concerned though that it will prevent proper logging of the clients IP. Does it send the proxy's ip to the webserver when using a reverse proxy(web accelerator) or does it send the client's ip and function as the gateway back to the client for the server?

Thanks
 
Old 05-23-2003, 04:59 PM   #4
xcon
Member
 
Registered: Jan 2002
Location: Ohio
Distribution: Slackware 9.1 (and some 9.0)
Posts: 181

Rep: Reputation: 30
wait... squid as a web-accelerator on the server side? weird... is it supposed to take some load off the webserver as well?

i'm pretty sure it will give the proxy's internal IP, since that's what every server gets when you go through a proxy as a client, the proxy becomes the client

http://squid.visolve.com/squid24s1/contents.htm
look at section XI (you might have already)

Last edited by xcon; 05-23-2003 at 05:26 PM.
 
Old 05-24-2003, 06:09 AM   #5
Robert0380
Guru
 
Registered: Apr 2002
Location: Atlanta
Distribution: Gentoo
Posts: 1,280

Rep: Reputation: 46
if you mean load balancing then you'd just do this:


iptables -A PREROUTING -p tcp --dport 80 -j DNAT --to 192.168.0.10 192.168.0.11

that sends every other request to 10 and every other request to 11 (or something like that) but not all requests to both.


edit: you would do that on the 123 machine of course
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to define a specific range of IPs and/or multiple IPs in an iptables rule?... TheHellsMaster Linux - Security 9 09-20-2004 10:06 AM
?? Private Pix ?? g452 Linux - Software 0 05-15-2004 06:53 AM
eth0:9 incorrect IPs ,and eth0 not IPs WannaLearnLinux Linux - Networking 10 10-26-2003 08:50 PM
private user gemcat Slackware 2 06-16-2003 04:14 PM
Multiple NIC cards - public and private IPs harryinjapan Linux - Networking 2 12-02-2001 04:25 AM


All times are GMT -5. The time now is 06:34 PM.

Main Menu
 
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
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration