Forum Discussion
jdeeby_270877
Nimbostratus
Jan 30, 2018irule to only allow specified IPs to connect to Vitrual
Hello I am looking to create an irule that will only allow connections to a VIP from a list or allowed IP's. Does anyone have a solution that they have used in the past with success on this?
My thought was something like create a group like $trustedIP
Then when
When client accepted if eq $trustedIP
allow elseif not eq block
1 Reply
Sort By
Hi jdeeby,
you could use LTMs data-groups as a storage for your white-listed IPs and then use an iRule during
event, to compare the connectingCLIENT_ACCEPTED
with your data-group information.[IP::client_addr]
Data-Group Config:
ltm data-group internal DG_MY_ALLOWED_IPs { records { 1.1.1.1/32 {} 2.2.2.0/24 {} } type ip }
iRule Syntax to drop the connection on a TCP layer:
when CLIENT_ACCEPTED { if { [class match [IP::client_addr] equals DG_MY_ALLOWED_IPs] } then { Allow trusted clients } else { Drop untrusted clients drop } }
Cheers, Kai
Recent Discussions
Related Content
DevCentral Quicklinks
* 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
Discover DevCentral Connects