Forum Discussion

slesh_219299's avatar
Feb 23, 2017
Solved

irule allow only one IP to VIP

Hi guys I need to allow only one ip to vip and will this help ?

    when CLIENT_ACCEPTED {
    if { ( [IP::addr [IP::client_addr] equals "11.22.33.44"] )
       } then {
 Allow 
    } else {
 DROP
        reject
    }
}
  • Ok I had to go with data group

    when CLIENT_ACCEPTED {
     Check the data group
    if { ! ([class match [IP::client_addr] equals allow_2_IP ]) } {
         Not valid client
        drop
    }
    

    }

    works fine but if someone have irule which allow only 2 ips it would be great also 🙂

4 Replies

  • Should work. You can use drop instead of reject if you don't need to inform the client and just drop silently.

     

  • Or this:

    when CLIENT_ACCEPTED {
        if { !( [IP::addr [IP::client_addr] equals "11.22.33.44"] ) } {
            reject
        }
    }
    
  • Or this without iRule:

     

    From GUI:

     

    Local Traffic ›› Virtual Servers : Virtual Server List >> my_virtual_server

     

    source : 11.22.33.44/32

     

  • Ok I had to go with data group

    when CLIENT_ACCEPTED {
     Check the data group
    if { ! ([class match [IP::client_addr] equals allow_2_IP ]) } {
         Not valid client
        drop
    }
    

    }

    works fine but if someone have irule which allow only 2 ips it would be great also 🙂