Page 1 of 1

Custom Rule for MariaDB - Ask for Advice

Posted: Wed Jul 13, 2022 8:35 am
by absolutemusik
Dear all,
I would like to have 3 different public IP to access the MariaDB running on a VPS with myVestaCP.
Say (public IPs):
11.11.11.11
22.22.22.22
33.33.33.33

First of all, I have added 11.11.11.11 on the FIREWALL setting for DB (administration page -> FIREWALL tab -> "ACCEPT TCP /DB 3306,5432 11.11.11.11").
Then, I have created a custom.sh (/usr/local/vesta/data/fiewall) and add the following lines.

Code: Select all

#!/bin/bash

iptables -A INPUT -s 22.22.22.22,33.33.33.33 -p tcp -m multiport --dports 3306,5432 -j ACCEPT
It is now connecting from these whitelisted IP addresses.

Please suggest whether I am taking the best way to do so. :?: :?: :?: Thanks in advance.

Willie

Re: Custom Rule for MariaDB - Ask for Advice

Posted: Wed Jul 13, 2022 10:20 am
by myVesta
absolutemusik wrote: Wed Jul 13, 2022 8:35 amFirst of all, I have added 11.11.11.11 on the FIREWALL setting for DB (administration page -> FIREWALL tab -> "ACCEPT TCP /DB 3306,5432 11.11.11.11").
No need for custom.sh, you could just add 3306,5432 in Firewall page for another two IPs.