3

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?

4
  • You need to set ip tunnel. check here Commented Nov 13, 2014 at 7:34
  • 1
    eth0:0 is not a virtual IP address. Commented Nov 13, 2014 at 8:12
  • 1
    It sounds like you need cur-loader Commented Nov 13, 2014 at 8:38
  • I used following cURL command to send request from eth0:1 " curl--interface 10.91.56.2 http:/10.91.55.3/file0.txt" and I was successful in generating traffic from virtual eth0:1. Can anyone guide me how to do this using python? 10.91.56.2 is my virtual eth0:1 IP interface and 10.91.55.3 is my server address... Commented Nov 24, 2014 at 10:50

1 Answer 1

0

2 options:

  1. 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
  1. 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)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.