Simulating multiple IP access

1

3

Is there any way to simulate multiple IP access for a particular app (my app) from one machine? I do create some interesting facts/reports based on client IP, which is not related in anyway to app functionality, so I need to test from a good number of clients/IPs (say 500ish). Appreciate any help/suggestions

vpram86

Posted 2013-04-15T12:29:02.623

Reputation: 1 978

Answers

1

I would need more information, but will try to make a guess (assuming you can work with a Linux distribution):

If ("multiple IP access" doesn't mean different IPs)
{
    If (your application doesn't need interaction, but only an http request)
    {
        I would try several wget in parallel launched from a shell script
    }
    else // == your application needs interaction
    {
        Can you program a light client (let's say python, java...) to simulate one client and launch several simultaneously?
    }
}
else // == you need different IPs
{
    If (the IPs need to be public)
    {
        I would try to work on wget/light client accesing different proxy servers on the Internet.
    }
    else // == they can be private
    {
        I would first try to create about 500 subinterfaces (eth0:n). This means 2 /24, and some work on address space on your private site. Once you have the subinterfaces, I would try the wget/light client over different subinterfaces.
    }
}

David

Posted 2013-04-15T12:29:02.623

Reputation: 171

I am not aware about sub-interfaces; trying to get more info now; Meanwhile; just a quick question. Can each subinterface have different IP in the network? – vpram86 – 2013-04-15T14:33:43.627

1Yes, sub-interfaces can have different IP addresses (even from different prefixes). – David – 2013-04-15T15:52:31.333

wow thats nice; so all I need to do is use a random prefixd ip for sub and use ip route add or something similar? – vpram86 – 2013-04-15T16:15:46.417

1This is an example of how you could create as many subinterfaces as you wish: for (( i = 10; i <= 11; i++ )); do sudo ifconfig eth0:$i 192.168.1.$i/24 up; done And then you have your new subinterfaces: $ ifconfig -a eth0 [...] eth0:10 Link encap:Ethernet direcciónHW 00:0c:29:e3:cf:a7 Direc. inet:192.168.1.10 Difus.:192.168.1.255 Másc:255.255.255.0 eth0:11 Link encap:Ethernet direcciónHW 00:0c:29:e3:cf:a7 Direc. inet:192.168.1.11 Difus.:192.168.1.255 Másc:255.255.255.0 (I can't insert new lines) – David – 2013-04-16T07:32:14.740

Just one more question; if you could please :). Can I have prefix for VLANs that differs from host IP. For example my physical host IP is 10.1.5.x and if I create a vlan, can I give 192.168.1.x address? Or I have to stick with the same prefix as actual host? – vpram86 – 2013-04-18T10:22:59.323

1That depends a lot on the route tables in your destination (application) and origin hosts. If subinterfaces are configured with 192.168.1.x, the first hop will need an interface with IP in that network, and the destination host will have to know how to respond to that prefix. – David – 2013-04-20T10:45:48.683

1

Just one advice. In the IPv6 (better to say Dual Stack) evolution path, it will be really common to have IPv4 users behind a CGNAT44; this means several users will be visible behind the same public IPv4 address. So it will be possible that several users access your application on the same public IPv4 address. Because of this, you should develop your applications not relying on the belief that "one IP means one user".

David

Posted 2013-04-15T12:29:02.623

Reputation: 171

Good advice; but like I said I am collecting facts based on IP; Like How many access from specific geographic location and such; Not talking about users at all here. – vpram86 – 2013-04-15T14:30:11.723