Forum Discussion
Blocking wp-login on wordpress ..
Hi All, I need to block the access on wp-login resource from external ip.
I try this Irule :
when HTTP_REQUEST { if { ! ([IP::addr "10.0.0.0 mask 255.0.0.0" equals [IP::client_addr]]) } { log local0. "Client IP: [IP::client_addr]" switch -glob [string tolower [HTTP::uri]] { "/admin" { log local0. "ADMIN" drop log local0. "Dropped admin [IP::client_addr]" } "/wp-login" { log local0. "LOGIN" drop log local0. "Dropped login [IP::client_addr]" } default { return } } } }
but doesn't work the drop instruction.
I try the HTTP::respond 403 content {Not Authorized 403 !} command but I don't have (or I don't know) how enabling HTTP profile on VS.
I have this final version "BIG-IP 9.4.5 Build 1049.10 Final" and on pool I have SNAT option.
Any suggestions ?
5 Replies
- What_Lies_Bene1
Cirrostratus
If you do actually have a HTTP profile assigned, try this (I've just tidied up the test expression);
when HTTP_REQUEST { if { ! [IP::addr [IP::client_addr] equals 10.0.0.0/24) } { log local0. "Client IP: [IP::client_addr]" switch -glob [string tolower [HTTP::uri]] { "/admin" { log local0. "ADMIN" drop log local0. "Dropped admin [IP::client_addr]" } "/wp-login" { log local0. "LOGIN" drop log local0. "Dropped login [IP::client_addr]" } default { return } } } }If you don't have a HTTP profile assigned, change the event to 'when CLIENT_ACCEPTED'.
- mariofimiani_13
Nimbostratus
I switch on HTTP profile and it works !
Thanks
- What_Lies_Bene1
Cirrostratus
OK, great. As noted by JR, you could reverse that and change the event to save a few CPU cycles etc.
- cristena_holks_
Nimbostratus
great answer Lies, thanks for the help!
- Charlie_Foster_
Nimbostratus
Hello friends, I am working on WordPress and also looking for the same. However the process mentioned here is not working with my theme as it still shows error. Should try any security plugin or instead go for hand coding. As I am not so much code savvy, hence kindly reply it in simple manner.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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
