Applicable to:
- SolusVM 2
Question
How to allow/block SMTP traffic for a particular SolusVM 2 VPS?
Answer
This functionality is yet to be implemented in SolusVM 2. There is a feature request for such functionality with ID #SIO-4345 (SVM2-68), which is scheduled in the product roadmap.
As a workaround:
- Login to SolusVM 2 admin panel
- Browse to SolusVM 2 > Virtual Servers and note the Hypervisor ID(UUID) and ID of the corresponding VPS:
- Connect to the corresponding Compute Resource via SSH
- Open the file /usr/local/solus/ovs/UUID/rules in text editor.
Where UUID is the UUID of the corresponding VPS from step 2 - Add the following rules to disable SMTP traffic or Remove them to enable SMTP traffic: For destination:
CONFIG_TEXT: ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp tcp_dst=25 action=drop"
For source:
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp tcp_dst=465 action=drop"
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp tcp_dst=587 action=drop"
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp6 tcp_dst=25 action=drop"
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp6 tcp_dst=465 action=drop"
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp6 tcp_dst=587 action=drop"CONFIG_TEXT: ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp tcp_src=25 action=drop"
Replace ID with the ID of the VPS from step 2.
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp tcp_src=465 action=drop"
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp tcp_src=587 action=drop"
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp6 tcp_src=25 action=drop"
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp6 tcp_src=465 action=drop"
ovs-ofctl add-flow br-int "in_port=sol-ID priority=37000 tcp6 tcp_src=587 action=drop" - Restart VPS at SolusVM 2 > Virtual Servers > VPS
How to test
# telnet <IP> 25
220 <domain name> ESMTP service ready
HELO <domain name>
250 <domain name> says hello
MAIL FROM:<mail address>
250 2.1.0 MAIL ok
RCPT TO:<mail address>
550 5.7.1 relaying denied: <mail address> in "RCPT TO:<mail address>"
Comments
Please sign in to leave a comment.