Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion
  • Search

Reset IPTables

General questions about VestaCP
Post Reply
  • Print view
Advanced search
4 posts • Page 1 of 1
Preston159
Posts: 2
Joined: Wed Feb 18, 2015 1:12 am

Reset IPTables
  • Quote

Post by Preston159 » Sun May 03, 2015 2:13 am

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.
Top

skurudo
VestaCP Team
Posts: 8099
Joined: Fri Dec 26, 2014 2:23 pm
Contact:
Contact skurudo
Website Facebook Google+ Skype
Twitter

Re: Reset IPTables
  • Quote

Post by skurudo » Tue May 05, 2015 12:45 pm

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
Top

jodumont
Posts: 26
Joined: Fri Jan 05, 2018 3:03 pm

Os: Debian 8x
Web: nginx + php-fpm
Re: Reset IPTables
  • Quote

Post by jodumont » 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
Top

Llorca
Posts: 9
Joined: Mon Feb 12, 2018 5:42 pm

Os: Debian 8x
Web: apache + nginx
Re: Reset IPTables
  • Quote

Post by Llorca » Wed Sep 26, 2018 4:36 pm

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...
Top


Post Reply
  • Print view

4 posts • Page 1 of 1

Return to “General Discussion”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password