Page 1 of 1

Delete iptables file/reset iptables

PostPosted: November 19th, 2017, 2:45 am
by Satyros
Hello,

I did setup a firewall with iptables in the following way:
Code: Select all
nano /etc/iptables.[myfilename].rules

Than I entered the rules:
Code: Select all
*filter
[Rules]
COMMIT

Code: Select all
iptables-restore < /etc/iptables.[myfilename].rules
nano /etc/network/if-pre-up.d/[myfilename]

Than I wrote the following.
Code: Select all
#!/bin/sh
/sbin/iptables-restore < /etc/iptables.[myfilename].rules

Code: Select all
chmod +x /etc/network/if-pre-up.d/[myfilename]


Instead of directly using iptables I decided to use ufw first (at least for the beginning). I think in this case it might better do delete the created iptable file or to reset iptables to the initial state before I entered the rules. I am not totally sure how to do this. Could anybody help me with this issue?
Thanks.

Re: Delete iptables file/reset iptables

PostPosted: November 20th, 2017, 12:49 am
by Satyros
If I am right, than the following should do the job:
Code: Select all
cd /etc
rm iptables.[myfilename].rules


and:
Code: Select all
cd /etc/network/if-pre-up.d
rm [myfilename]


Could anybody confirm this, before I delete something I still need? And is there any file, I have forgotten?
Thanks.

Re: Delete iptables file/reset iptables  Topic is solved

PostPosted: December 6th, 2017, 1:18 am
by Satyros
I renamed the files and I have the default again...