Forum Discussion

averma16_369349's avatar
averma16_369349
Icon for Nimbostratus rankNimbostratus
Aug 14, 2018

Block IP Address on Fly

What is the best way to block list of IP addresses.

  • One could be use an iFile and using iRule, reject traffic matching ip addresses in that file.
  • Another one could be using DataGroup and following script (BlockIpRange)
    when CLIENT_ACCEPTED { if { ([ class match [IP::remote_addr] equals ipblock ]) } { reject } }

My main task is that I want to be able to call rest end points(icontrol-rest-api-reference) in order to do it via script. That is, supply an IP Addresss on fly and block it.

for iFile option, I cannot find and option to append to existing iFile for DataGroup I am not sure how to update existing dataGroup?

I need a rest api end point I can use for f5 asm, using which I can block an IP address on fly.

In case of iFile, I couldn't find an option to append information to existing file. I need to dynamically update the file with Ip Adress so that ip can be blocked when next traffic arrives. (Will it only update in the running instance or in the physical file as well?)

In case of Data Group, I am not able to find an example to use it?

Let me know if more information is required.

Any help/pointers?

2 Replies