Learn F5 Technologies, Get Answers & Share Community Solutions Join DevCentral

Filter by:
  • Solution
  • Technology
Answers

how can i make irule to block port 25 on virtual server?

hi all, can i block port 25 on virtual server which has service port (0) any ??

0
Rate this Question

Answers to this Question

placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Yes. you can achieve via policy also. Please find the irule.

    when CLIENT_ACCEPTED {
 if { ([string tolower [HTTP::host]] equals "xyz.com") && ([TCP::local_port] == 25)} {
        drop
    log local0. "connection dropped from [HTTP::host]"
         }
    }
0
Comments on this Answer
Comment made 21-Dec-2017 by yosry92 69

how can i block it via policy??

0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Do you really require a Any port virtual server.

Starting with Exchange 2013, all exchange services are on HTTPS port.

if you require it, try this irule:

when CLIENT_ACCEPTED {
    if {  [TCP::local_port] == 25} {
        TCP::respond "500 Service not available, closing transmission channel"
     }
}
0
placeholder+image
USER ACCEPTED ANSWER & F5 ACCEPTED ANSWER

Blocking a single port violates the security best practices (which are often requirements) of "least privilege" and "default deny". I would recommend turning it around and allowing only what you actually need, even on a VIP that is configured to allow all ports.

0