All of lore.kernel.org
 help / color / mirror / Atom feed
* [LARTC] Using iproute2 to bond two Internet lines for a webserver.
@ 2003-04-08  1:04 Dustin Puryear
  0 siblings, 0 replies; only message in thread
From: Dustin Puryear @ 2003-04-08  1:04 UTC (permalink / raw)
  To: lartc

I am relatively new to iproute2. Any information on the topic below would 
save me considerable time. I appreciate any help, thanks.

We want to plug two lines into a webserver to increase the bandwidth 
available to the hosted sites. Rather than use round-robin DNS we would 
prefer to use iproute2 to use equal cost routing across the two lines. 
However, I am still not sure how well that will work. Let's say we have a 
DNS A record for a website:

100.200.300.400	IN	A	www.example.com.

Also assume we now have two incoming pipes where our public IP addresses 
are 100.200.300.400 and 1.2.3.4. We then use iproute2 to create an equal 
cost routing rule for use of both interfaces.

So let's consider when a client connects to the website at 100.200.300.400. 
Can we cause the kernel to route our traffic over our 1.2.3.4 link instead 
of 100.200.300.400? That is, can we load-balance (or at least load-share) 
our outgoing traffic? I would think the client TCP/IP stack would reject 
the returned packet as being bogus unless we can cause our outgoing packet 
to spoof the 100.200.300.400 address.

I do have the process of using iproute2 to define these rules almost 
working. However, one issue is definitely throwing me for a loop. We have 
two IP addresses but our downstream gateway is the same. So I have 
100.200.300.400 with gateway 6.7.8.9 and 1.2.3.4 with gateway 6.7.8.9. (We 
are allocated two IPs from the same subnet.) So far I have:

...
# setup our routes to our gateways
ip route add $GW1 src $IP1 dev $IF1
ip route add $GW2 src $IP2 dev $IF2

# setup interface specific routing tables
ip route add $NET1/$CIDR1 dev $IF1 table 200
ip route add default via $GW1 dev $IF1 table $TABLE1
ip route add $NET2/$CIDR2 dev $IF2 table 100
ip route add default via $GW2 dev $IF2 table $TABLE2

# create a default route with a multipath route
ip route add default scope global nexthop via $GW1 \
                                   nexthop via $GW2

ip rule add from $GW1 table $TABLE1
ip rule add from $GW2 table $TABLE2
...

So here $GW1 = $GW2. How can I define this so that the kernel knows to 
alternate between the two interfaces even though the gateway is the same 
for both?

---
Dustin Puryear <dustin@puryear-it.com>
Puryear Information Technology
Windows, UNIX, and IT Consulting
http://www.puryear-it.com



_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-04-08  1:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-08  1:04 [LARTC] Using iproute2 to bond two Internet lines for a webserver Dustin Puryear

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.