Forum Discussion
cammy_178041
Nimbostratus
Apr 21, 2015Need an irule to block incoming connections if not matching a defined data group of addresses
Hi
I am trying to create an irule to block incoming smtp connections unless the originating ip is part of the block of ip addresss i have created in a data group. Where can i find this? Sorry -...
DEJ_159363
Cirrus
Apr 21, 2015Hello,
Edit - just realized I had [TCP::client_addr] instead of [IP:client_addr]
I'm relatively new as well, but you may want to try the below. If the traffic is going to port 25 and the client IP is not included in your allow list, it is set to drop the traffic. All others will go to the default pool, if one is set.when CLIENT_ACCEPTED {
Check if destination port is SMTP and the client IP is not in the allow list
if {[[TCP::local_port] equals 25] and [class match [IP::client_addr] ne DATAGROUPNAME]}{
Drop the traffic
drop
}
}
DEJ_159363
Cirrus
Apr 21, 2015I don't know where you are applying this iRule which is why I went ahead and specified the destination port.
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