Re: [webmin-l] IPTABLES restore under OpenVZ

Andrey Repin <[email protected]>
Newsgroups gmane.comp.web.webmin.general
Message-ID <[email protected]>
Greetings, Joaquim Homrighausen!

> I can't remember if we've talked about this before, sorry if it's a dupe.

> OpenVZ containers running Linux seem to rewrite /etc/network/interfaces 
> every time it re-boots.

It doesn't, normally, but up to the each hosting provider.

> Wouldn't this indicate that /etc/network/interfaces is a bad place to 
> put iptables restore actions

Yes.

> and that they should go in /etc/rc.local?

No.

> I have from time to time found some of our VPS with no active firewall (!)

Firewall (netfilter) is part of Linux kernel and can not be easily take out.

> though Webmin thinks there is one (because I don't click revert) ... if
> I simply click "Apply changes" and set the "Start firewall on boot" to 
> yes, it all works, until it happens again ...

That's because firewall is always there.

On a topic of populating its rules,

#!/bin/sh
chmod -x /etc/network/if-up.d/iptables-rules
cp --backup=numbered -aT -- /etc/network/if-up.d/iptables-rules /var/backups/iptables-rules
echo "#!/sbin/iptables-restore" > /etc/network/if-up.d/iptables-rules
iptables-save >> /etc/network/if-up.d/iptables-rules
chmod +x /etc/network/if-up.d/iptables-rules

> Or am I dreaming?

Nop.

> (On a side note, it'd be nice with a show currently active firewall 
> without having to revert/etc, another idea is to allow Webmin to display 
> differences between actual and what Webmin thinks)

Probably. But I'm not using webmin fw tool, it's cumbersome.


-- 
With best regards,
Andrey Repin
Tuesday, December 13, 2016 00:33:38

Sorry for my terrible english...


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
-
Forwarded by the Webmin mailing list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-list
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.