I am using CentOS-Linux and I want to send HTTP requests from virtual IP addresses like eth0:0,eth0:1,eth0:2,etc simultaneously with eth0. How to do this? I am actually tring to make one traffic generator tool using Python. I have been successful in sending multiple and concurrent HTTP requests and now my next step is to send such requests from multiple IP addresses. I dont know how to achieve this task. Can anyone help me?
1 Answer
2 options:
- use curl:
curl --i <'interface ip using which you want to generate traffic'> destination
eg for me, eth0's ip is 10.91.56.3 and eth0:1's ip is 10.91.56.4 so, to generate traffic using 10.91.56.4(eth0:1)
curl --i 10.91.56.4 http://10.91.55.3/filex.txt
- followed answer by @AKX here
In above answer in 3rd class write your interface's ip instead of 127.0.0.1 eg in my case i did like this:
class BindableHTTPHandler(urllib2.HTTPHandler):
def http_open(self, req):
return self.do_open(BindableHTTPConnectionFactory('10.91.56.4'), req)
ip tunnel. check hereeth0:0is not a virtual IP address.