iptables on startup

5 respostas [Última entrada]
meydlo
Desconectado
Joined: 04/18/2015

Hi

Where is stored iptables rules in default Trisquel configuration that are loaded each time on start-up of the machine?

My goal is to change rules and load them each time on start-up before the network is loaded.
It would be ideal if I could just overwrite the current file from where are rules loaded now.
But I could not find anything like this /etc/iptables.*

Thank you very much

jxself
Desconectado
Joined: 09/13/2010

Make your rules. Then,
iptables-save > /etc/iptables.conf (or wherever you feel like storing them.)

Add the following command in /etc/rc.local to reload the rules in every reboot.
iptables-restore < /etc/iptables.conf (or wherever it was you put them.)

meydlo
Desconectado
Joined: 04/18/2015

Thank you for your response jxself,

I did described. The rules seems to be overwritten again.

The rules seems to be related to some configuration of virtual machine. I'm assuming so since all the rules are related to 'virbr0' which from my understanding should be virtual broadcast for my virtual machine.
I do have installed (qemu & Virtual Machina Manager)

Sorry if is the title a bit misleading(too late to change it), but does anyone have an idea where this could come from and how to edit it?

ADFENO
Desconectado
Joined: 12/31/2012

I think I know how to solve the issue, if I remember correctly, it has
to do with NetworkManager, which assumes that the end-user wants to do
anything by default. However, the ideal thing to do is *not* to remove
NetworkManager, but to make it so that it respects the iptables rules
when you have such rules.

With this in mind I found
[[https://help.ubuntu.com/community/IptablesHowTo?action=show&redirect=Iptables#Configuration_on_Startup_for_NetworkManager]]
(the documentation is under CC BY-SA 3.0, but I think that it's a good
idea to write our own documentation in the Trisquel wiki instead of
linking to this one all the time).

--
- [[https://libreplanet.org/wiki/User:Adfeno]]
- Palestrante e consultor sobre /software/ livre (não confundir com
gratis).
- "WhatsApp"? Ele não é livre, por isso não uso. Iguais a ele prefiro
GNU Ring, ou Tox. Quer outras formas de contato? Adicione o vCard
que está no endereço acima aos teus contatos.
- Pretende me enviar arquivos .doc, .ppt, .cdr, ou .mp3? OK, eu
aceito, mas não repasso. Entrego apenas em formatos favoráveis ao
/software/ livre. Favor entrar em contato em caso de dúvida.

meydlo
Desconectado
Joined: 04/18/2015

Lovely, this solved the issue :)

Really thanks Adfeno.
[SOLVED]

ADFENO
Desconectado
Joined: 12/31/2012

You're welcome! :)