Delete iptables file/reset iptables  Topic is solved

Post your Debian questions here.

Delete iptables file/reset iptables

Postby Satyros » November 19th, 2017, 2:45 am

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.
Satyros
 
Posts: 10
Joined: October 10th, 2017, 11:21 pm

Re: Delete iptables file/reset iptables

Postby Satyros » November 20th, 2017, 12:49 am

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.
Satyros
 
Posts: 10
Joined: October 10th, 2017, 11:21 pm

Re: Delete iptables file/reset iptables  Topic is solved

Postby Satyros » December 6th, 2017, 1:18 am

I renamed the files and I have the default again...
Satyros
 
Posts: 10
Joined: October 10th, 2017, 11:21 pm


Return to General Questions

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest

x