Forum Discussion
Can we read DataGroup form external file via iRule
Hi expert,
I'have internal server and provide url list. i would like to use ltm block access to url if match in datagroup. I create cronjob and shell script to download url form internal server. But i'm not sure how can i create iRule to read this url list.
So please recomend iRule parameter to me. Thank you
- Lee_Sutcliffe
Nacreous
If you format the URL list correctly, you can import it into an external datagroup.
e.g.
"name1" := "/path1", "name2" := "/path2", "name3" := "/path3",
Once setup, you can schedule a transfer of this list to F5.
Once on the box, you can schedule the following command using iCall or Cron to update the datagroup
modify sys file data-group [my-data-group-name] source-path file:/var/tmp/url.list
- youssef1
Cumulonimbus
Hi,
So first of create your DG "dg-uri-restriction":
- type string
- string: /uri
- value: not needed in your case.
Then create your irule, it's simple:
when HTTP_REQUEST { set userip [HTTP::uri] if { [class match $userip equals dg-uri-restriction] } { HTTP::respond 403 content "Forbidden" "Content-Type" "text/html" "Connection" "Close" return you can also use reject... } }
- Gimlie_329457
Nimbostratus
Thk you all, let me try and update back
- gimlie_382872
Nimbostratus
Hi all i try by your recomend is work, but when i try to add crontab. BIG-IP don't run schedule task.
Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com