iptables not working

Post Reply
verus
Posts: 9
Joined: Thu May 05, 2022 2:01 pm
iptables not working

Post by verus »

Hi,

I installed a new Debian VPS (9.4) and I upgraded to 11.
After that I installed MyVesta and everything works except iptables.
In the portal, iptables is grayed out and I cannot start it (it does nothing).

When I perform v-update-firewall I get:

v-update-firewall
/usr/local/vesta/bin/v-update-firewall: line 173: /sbin/iptables-save: No such file or directory

It looks logical because there is no /sbin/iptables but there is a /USR/sbin/iptables-save

I didn't change anything because I don't want to break things but how can I fix this iptables working well on this installation (it is a new installation) ?
Thanks.

User avatar
myVesta
Site Admin
Posts: 704
Joined: Fri Jun 19, 2020 9:59 am
Re: iptables not working

Post by myVesta »

apt update
apt install iptables-persistent

verus
Posts: 9
Joined: Thu May 05, 2022 2:01 pm
Re: iptables not working

Post by verus »

thank you for the reply.
I did that but it still is the same. In the portal iptables is still greyed out.

User avatar
myVesta
Site Admin
Posts: 704
Joined: Fri Jun 19, 2020 9:59 am
Re: iptables not working

Post by myVesta »

did you try to reboot the server?

verus
Posts: 9
Joined: Thu May 05, 2022 2:01 pm
Re: iptables not working

Post by verus »

Yes I did.

I just did a brand new installation from scratch:
- VPS is installed with Debian 9
- Update from Debian 9 to Debian 11 (no errors) - rebooted
- installation of iptables-persistent - rebooted
- installation of MyVesta - rebooted

Login in MyVesta
iptables is greyed out

In cli I see this when I want to check the firewall:

[email protected]:~# v-update-firewall
/usr/local/vesta/bin/v-update-firewall: line 173: /sbin/iptables-save: No such file or directory
[email protected]:~# v-stop-service iptables
/usr/local/vesta/bin/v-stop-firewall: line 65: /sbin/iptables-save: No such file or directory

I could change these files but with a brand new installation, I don't think that is meant to be? And even then, iptables is greyed out in the Myvesta portal.

On another system that I installed with Debian 11 from scratch, I don't have this error and iptables is in /sbin so maybe it has something to do with the dist-upgrade?
But I have no other choice than starting from 9 because that is what is provided.

Thank you, Ph.

User avatar
myVesta
Site Admin
Posts: 704
Joined: Fri Jun 19, 2020 9:59 am
Re: iptables not working

Post by myVesta »

on server with problem, type:

Code: Select all

whereis iptables-save
maybe it's in some other folder, so you can just symlink it to /sbin

User avatar
myVesta
Site Admin
Posts: 704
Joined: Fri Jun 19, 2020 9:59 am
Re: iptables not working

Post by myVesta »

ahh, you already wrote it's in /usr/sbin

ok, try then:

Code: Select all

ln -s /usr/sbin/iptables-save /sbin/iptables-save

verus
Posts: 9
Joined: Thu May 05, 2022 2:01 pm
Re: iptables not working

Post by verus »

this is working now:

[email protected]:~# v-update-firewall
[email protected]:~# v-stop-service iptables
[email protected]:~# v-start-service iptables

However, iptables in the myvesta portal (SERVER ==> iptables) is still greyed out.

User avatar
myVesta
Site Admin
Posts: 704
Joined: Fri Jun 19, 2020 9:59 am
Re: iptables not working

Post by myVesta »

but let's
v-update-firewall
be last command you run.

and do
iptables -L -n
so we can see if rules are there


Post Reply