[TriLUG] multiple IP from the same network card?

Jon Carnes jonc at nc.rr.com
Wed Jun 18 16:01:33 EDT 2003


I think Mike is right.

Aliasing is not going to get you what your looking for, though it is a
piece of the pie.  There are some low-level packet generation tools that
will allow you to send out multiple requests using various source IP's.
You have to run as root.
 
I played with them a few years ago when I was setting up an LVS cluster
and I needed to do some load-testing. I basically created a set of files
using tcpdump, edited the files and then pumped them into a packet
generator as fast as I could.  It worked a charm.

Sorry I can't remember the exact name of the packet generator...

Jon

On Wed, 2003-06-18 at 15:47, Mike Johnson wrote:
> 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




More information about the TriLUG mailing list