Web Hosting Talk







View Full Version : Routing Over two Networks @ the Server


KarlZimmer
04-08-2003, 03:34 AM
Hello there, I have an interesting situation here. I am running a basic web server, just a dedicated server from a certain company that has given me two IPs on two completely seperate networks. These networks as I said are completely seperate and the server is accessable over both IP's. What is the best way to setup my web server to best utilize the bandwidth and redundancy provided by both networks. Any suggestions would be appreciated and if anyone has any more questions regarding this just post a message. Thanks.

Note: I am using FreeBSD if that matters. Also, it is only one server, so paying for an expensive switch or something like that is out of the question.

Samuel
04-08-2003, 04:03 AM
Buy a router and load balance

KarlZimmer
04-08-2003, 04:23 AM
Guess you didn't read the whole message: Also, it is only one server, so paying for an expensive switch or something like that is out of the question.

Plus as I said, it's a dedicated server, so then I would also need to pay additional rack space for the router, etc.

Samuel
04-08-2003, 04:24 AM
Well then I guess the solution is to buy another server to take advantage of those "Two networks" =P

KarlZimmer
04-08-2003, 04:27 AM
So NOTHING can be done with one server to utilize both networks??

Slidey
04-08-2003, 04:34 AM
well the thing is with your routing table, you set rules as to where to route packets. so you add a default route for all packets as one of your networks..

say you have 2 interfaces, you can receive data on both, but you'd only send it on one of the 2... im not sure if fbsd will let you add 2 interfaces to send packets on, it'd be interesting if they did..

Samuel
04-08-2003, 04:35 AM
The server only needs one connection to the net. Two connections would mean you would have two nics. Do you have two nics?

MatthewN
04-08-2003, 04:35 AM
Surely you could just set both name servers up on the diffent networks and then traffic would flow in through each network. I believe name servers are prioritised on the first which responds... not dns1 first. So this should allow traffic on both.

Im not sure how effective that would be, but it would be the cheapest way.

Slidey
04-08-2003, 04:41 AM
this is a bit of a stretch as i cant remember too well but if you put the same host with 2 ips in 1 nameserver, doesnt it just return one of the 2 randomly ?

jbishop
04-08-2003, 04:44 AM
Round-robin DNS.

Set up the zone for the domain(s) this machine is hosting with A records for both IPs. Any client that does a lookup will get both IPs, and the resolver/web browser will select one at random.

KarlZimmer
04-08-2003, 04:53 AM
So is it possible to setup the DNS to point to both IPs and just leave it at that? Would I then need to have two entries for each domain in the httpd.conf file, one for each IP, or how would HTTPD handle it?

jbishop
04-08-2003, 04:56 AM
I believe as long as you're allowing Apache to bind to * (as opposed to a specific IP) it should respond on all interfaces.

Pretty easy to verify. :)

Slidey
04-08-2003, 05:19 AM
i knew it was something like that..

Winkie
04-08-2003, 05:22 AM
Your best bet is, as people have said, to buy a nice high layer router with bgp capabilities, therefore correctly utilising each network. Other than that it's a bit tricky.

Basically, each company has its best routes, in the UK, level3 have superb european routes as a pose to claranet for example, therefore if you have peering to both ISPs, you configure your router to route through level3 for certain routes.

Hard to explain, the routing table sounds interesting, most linux distributions allow eth0, eth0:1 etc which is effectively an alias but you can bind to it iirc.

jbishop
04-08-2003, 06:01 AM
Oh, uh, all these people suggesting ridiculous things like buying a load balancer, using BGP, etc... heh.

Talk about overkill.

Samuel
04-08-2003, 06:51 AM
I didn't recommend a load balancer. I said a router, and load balancing.

Winkie
04-08-2003, 07:04 AM
Originally posted by jbishop
Oh, uh, all these people suggesting ridiculous things like buying a load balancer, using BGP, etc... heh.

Talk about overkill.

What is the best way to setup my web server to best utilize the bandwidth and redundancy provided by both networks.

R>C>P asshat

ThomasB
04-08-2003, 09:17 AM
Person who suggested Round Robin DNS is the only way, if you don't wish to buy any extra equipement.
Thats assuming, you meant two nic's connected to the server.
The server should then be set to respond on the interface of the IP address that was used to contact it. (not sure about BSD though).
So you'll get 1st request on 1 nic, 2nd on other nic... etc.

Most people seem to assume your running virtual interfaces when you say you have 2 IPs, the word physical would have told them otherwise or if you'd mentioned 2 nics. 'Server with 2 IP adresses, connected to 2 physicaly seperate networks.'

I'll shuttit now.