blob: e5c1a254824226499e153986b7f1ac6e4c7cbd13 [file] [log] [blame] [raw]
[Unit]
Description=IPv4 Packet Filtering Framework
Before=network.target
Wants=network-pre.target
DefaultDependencies=off
ConditionPathExists=/etc/iptables/iptables.rules
[Service]
Type=oneshot
ExecStart=/sbin/iptables-restore /etc/iptables/iptables.rules
ExecReload=/sbin/iptables-restore /etc/iptables/iptables.rules
ExecStop=/bin/sh -c "while read table; do iptables -t $table --flush; iptables -t $table --delete-chain; iptables -t $table --list-rules | sed -En 's/^\\-P ([A-Z]+) DROP/\\1/p' | while read chain; do iptables -t $table --policy $chain ACCEPT; done; rmmod iptable_$table; done < /proc/net/ip_tables_names"
RemainAfterExit=on
[Install]
WantedBy=network.target