[TriLUG] multiple IP from the same network card?

Mike Johnson mike at enoch.org
Wed Jun 18 15:47:06 EDT 2003


Michael Winslow Czeiszperger [michael at czeiszperger.org] wrote:
> Hi--
> 
> I'm working on a new feature for our load testing product and have been 
> stumped on a Linux configuration issue. The product needs to send out 
> HTTP requests from multiple IP addresses in order to fake out IP-based 
> load balancers. To do this I need to configure a Linux box to have 
> multiple IP addresses on the same network card, but for the life of me 
> I can't find the HOWTO or docs to do this. Strangely enough it seemed 
> fairly easy on Windows :-(

What exactly are you trying to do?  You say you want to have requests
originate from your Linux host, and have those requests come from
different IP addresses.  A lot of people responded with how to tie
multiple IP addresses to your card, but that will only help for incoming
requests.  Outgoing requests/connections will originate with the IP
address of the primary interface.  So you can add all the IP addresses
you want, and the system will answer requests to those IPs, but when the
system originates a request, it will go out with the IP address of the
primary interface (subnets/routing non-withstanding).

If I understand what you're trying to do, it's not as easy as you think.
You'll need to get down at the network layer, and play around with raw
packets.  You need to craft packets with whatever source IP you want,
with your MAC address, send the request and then cope with the response
(and pass this up to your application, if needed).

I'm pretty certain that you'll need to head down this path, but I'm more
than happy to be proven wrong (but ya better have packet captures to
back ya up ;)

Mike
-- 
"If life hands you lemons, YOU BLOW THOSE LEMONS TO BITS WITH 
 YOUR LASER CANNONS!" -- Brak

GNUPG Key fingerprint = ACD2 2F2F C151 FB35 B3AF  C821 89C4 DF9A 5DDD 95D1
GNUPG Key = http://www.enoch.org/mike/mike.pubkey.asc

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 230 bytes
Desc: not available
URL: <http://www.trilug.org/pipermail/trilug/attachments/20030618/98b7d372/attachment.pgp>


More information about the TriLUG mailing list