Custom Rule for MariaDB - Ask for Advice

Post Reply
absolutemusik
Posts: 13
Joined: Wed Feb 03, 2021 10:01 am

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

Tags:
User avatar
myVesta
Site Admin
Posts: 928
Joined: Fri Jun 19, 2020 9:59 am
Has thanked: 8 times
Been thanked: 6 times

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.
Post Reply