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...
Kai_Wilke
MVP
Jan 30, 2018Hi jdeeby,
you could use LTMs data-groups as a storage for your white-listed IPs and then use an iRule during
CLIENT_ACCEPTED event, to compare the connecting [IP::client_addr] with your data-group information.
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
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)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