Default configuration iptables, how to avoid to be blocked when flushing tables?
0
votes
2
answers
223
views
I have this base for [tag:iptables] when I have a new server to configure :
*filter
:INPUT DROP [0:0]
:FORWARD DROP [0:0]
:OUTPUT ACCEPT [0:0]
# Keep state.
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
# Loop device.
-A INPUT -i lo -j ACCEPT
# Allow PING from remote hosts.
-A INPUT -p icmp --icmp-type echo-request -j ACCEPT
# allow ssh port 22
-A INPUT -p tcp --dport 22 -j ACCEPT
# allow foobar public IP
-A INPUT -p tcp -s 9.8.7.6 -j ACCEPT
# Allow outgoing trafic
-A OUTPUT -p tcp -d 1.2.3.4 -j ACCEPT
-A OUTPUT -o enp8s0 -d 0.0.0.0/0 -j ACCEPT
COMMIT
I load this file with
iptable-restore < file
.
The issue is that when I flush with iptables -F
, I get blocked.
What I have to do to avoid to be blocked ?
Asked by Mévatlavé Kraspek
(541 rep)
Sep 22, 2019, 03:38 AM
Last activity: Sep 24, 2019, 03:46 AM
Last activity: Sep 24, 2019, 03:46 AM