Forum Discussion

Naresh_N's avatar
Naresh_N
Icon for Nimbostratus rankNimbostratus
Oct 04, 2018

Detecting nodes that are up in a subnet

Hi all, would like an iRule to go though all nodes that are up in a /24 subnet e.g. 10.1.1.0/24 and detect the nodes that are up. For each of these up nodes, would like to send a URI that was received in an HTTP Request to a VIP. How do I go about it?

 

Thanks

 

2 Replies

  • Okay, so to clarify, you have a bunch of servers in the 10.1.1.0/24 range. An HTTP request comes into the VIP, and you want to send this request to ALL of the servers that are available in this IP range?

     

    Monitors are usually the best way to go to define availability, the downside here being that you'd have up to 254 servers in your pool. That said, polling 254 IPs on every request would be massively slow, and not something you'd generally want to do in an iRule anyway. The next problem would be multi-casting the request to multiple servers. A proxy (BIG-IP) expects a single response.

     

  • I simple range loop would work best for something like this:

    set data "GET /[HTTP::uri] HTTP/1.0\r\n\r\n"
    for i {115 116 117 118 119 120} {
        set ip "10.1.1.${i}"
        set conn1 [connect -timeout 3000 -idle 30 -status conn1_status ${ip}]
        ...
    }