Skip to content Skip to sidebar Skip to footer

How To Send Http Request Using Virtual Ip Address In Linux?

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 ma

Solution 1:

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:

classBindableHTTPHandler(urllib2.HTTPHandler):defhttp_open(self, req):
        returnself.do_open(BindableHTTPConnectionFactory('10.91.56.4'), req)

Post a Comment for "How To Send Http Request Using Virtual Ip Address In Linux?"