Page 1 of 1

[SOLVED] Add Firewall Rules via Vesta CLI

Posted: Wed Apr 01, 2015 9:28 am
by mehargags
Hi all,
I was wondering what Will be the Commands to update/Add/Delete any Firewall rules via VestaCP CLI.

For Eg: just after the Vesta install, I'd want Port 8090 open for my specific application. What will be the command ?

Re: Add Firewall Rules via Vesta CLI

Posted: Thu Apr 02, 2015 7:48 pm
by skurudo
/usr/local/vesta/bin/v-add-firewall-rule

# info: add firewall rule
# options: ACTION IP PORT [PROTOCOL] [COMMENT] [RULE]

Re: Add Firewall Rules via Vesta CLI

Posted: Thu Jan 07, 2016 3:38 am
by mehargags
So What exactly will be the command as per the syntax if I want Add this Firewall rule :

Name of the Rule : BHS-port
Type : ALLOW
port : 8813

for all IPs: 0.0.0.0/0

can you write the exact command line for this please ?

ACTION IP PORT [PROTOCOL] [COMMENT] [RULE]
ACCEPT 0.0.0.0/0 8813 TCP BHS-port ??

Re: Add Firewall Rules via Vesta CLI

Posted: Thu Jan 07, 2016 5:37 am
by BBuchanan1013
skurudo wrote:/usr/local/vesta/bin/v-add-firewall-rule

# info: add firewall rule
# options: ACTION IP PORT [PROTOCOL] [COMMENT] [RULE]
I would assume:

Code: Select all

/usr/local/vesta/bin/v-add-firewall-rule allow 0.0.0.0/0 8813 TCP BHS-port any

Re: Add Firewall Rules via Vesta CLI

Posted: Thu Jan 07, 2016 5:03 pm
by mehargags
Thanks.

What is the "RULE" part actually ? I don't see any such field in the VestaCP firewall section

Re: Add Firewall Rules via Vesta CLI

Posted: Thu Jan 07, 2016 10:09 pm
by skurudo
mehargags wrote: What is the "RULE" part actually ? I don't see any such field in the VestaCP firewall section
It's number, just a number - see in /usr/local/vesta/data/firewall/rules.conf
RULEShow
RULE='1' ACTION='ACCEPT' PROTOCOL='ICMP' PORT='0' IP='0.0.0.0/0' COMMENT='PING' SUSPENDED='no' TIME='17:13:48' DATE='2014-09-16'
RULE='2' ACTION='ACCEPT' PROTOCOL='TCP' PORT='8083' IP='0.0.0.0/0' COMMENT='VESTA' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
RULE='3' ACTION='ACCEPT' PROTOCOL='TCP' PORT='3306,5432' IP='0.0.0.0/0' COMMENT='DB' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
RULE='4' ACTION='DROP' PROTOCOL='TCP' PORT='143,993' IP='0.0.0.0/0' COMMENT='IMAP' SUSPENDED='no' TIME='18:08:53' DATE='2015-12-01'
RULE='5' ACTION='DROP' PROTOCOL='TCP' PORT='110,995' IP='0.0.0.0/0' COMMENT='POP3' SUSPENDED='no' TIME='18:08:35' DATE='2015-12-01'
RULE='6' ACTION='ACCEPT' PROTOCOL='TCP' PORT='25,465,587,2525' IP='0.0.0.0/0' COMMENT='SMTP' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
RULE='7' ACTION='ACCEPT' PROTOCOL='UDP' PORT='53' IP='0.0.0.0/0' COMMENT='DNS' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
RULE='8' ACTION='ACCEPT' PROTOCOL='TCP' PORT='21,12000-12100' IP='0.0.0.0/0' COMMENT='FTP' SUSPENDED='no' TIME='07:40:16' DATE='2014-05-25'
RULE='9' ACTION='ACCEPT' PROTOCOL='TCP' PORT='80,443' IP='0.0.0.0/0' COMMENT='WEB' SUSPENDED='no' TIME='17:04:27' DATE='2014-09-24'
RULE='10' ACTION='ACCEPT' PROTOCOL='TCP' PORT='22' IP='0.0.0.0/0' COMMENT='SSH' SUSPENDED='no' TIME='17:14:41' DATE='2014-09-16'
RULE='11' ACTION='ACCEPT' PROTOCOL='TCP' PORT='10001' IP='0.0.0.0/0' COMMENT='Monit' SUSPENDED='no' TIME='21:03:29' DATE='2015-11-29'

Re: Add Firewall Rules via Vesta CLI

Posted: Sat Jan 09, 2016 6:03 am
by mehargags
Thanks -- I got it

Re: [SOLVED] Add Firewall Rules via Vesta CLI

Posted: Tue Jan 12, 2016 10:36 am
by skurudo
Ok, close ;-)