Page 1 of 1

Reset IPTables

Posted: Sun May 03, 2015 2:13 am
by Preston159
I wasn't sure which thread to put this in, but this seemed like the best option.

After uninstalling Vesta, I am no longer able to connect via SSH (which is not running on port 22, but on a miscellaneous port in the 40000s range). How can I permanently remove Vesta's IPTables rules and reset them to the Ubuntu 14.04 default?

I do currently have access to the server via an IPMI, so I can make whatever changes are necessary.

Re: Reset IPTables

Posted: Tue May 05, 2015 12:45 pm
by skurudo
Simple answer will be

Code: Select all

iptables -F
But to remove all rules and filtres, make fw.sh with come below

Code: Select all

#!/bin/sh
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
and

Code: Select all

chmod +x fw.sh

Re: Reset IPTables

Posted: Wed Sep 26, 2018 1:16 am
by jodumont
by looking at :

Code: Select all

https://github.com/serghey-rodin/vesta/blob/master/bin/v-update-firewall
I'll say:
find and modify inside the firewall rules

Code: Select all

nano $VESTA/data/firewall/rules.conf
such as an example I restrained the port 8083 to my VPN but it went down so I replace the VPNsubnet by 0.0.0.0/0 :

Code: Select all

VPNsubnet="10.1.1.0/24"
sed "s|$VPNsubnet|0.0.0.0/0|g" -i $VESTA/data/firewall/rules.conf
then

Code: Select all

v-update-firewall

Re: Reset IPTables

Posted: Wed Sep 26, 2018 4:36 pm
by Llorca
jodumont wrote:
Wed Sep 26, 2018 1:16 am
by looking at :

Code: Select all

https://github.com/serghey-rodin/vesta/blob/master/bin/v-update-firewall
I'll say:
find and modify inside the firewall rules

Code: Select all

nano $VESTA/data/firewall/rules.conf
such as an example I restrained the port 8083 to my VPN but it went down so I replace the VPNsubnet by 0.0.0.0/0 :

Code: Select all

VPNsubnet="10.1.1.0/24"
sed "s|$VPNsubnet|0.0.0.0/0|g" -i $VESTA/data/firewall/rules.conf
then

Code: Select all

v-update-firewall


Perfect...