- <http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch14_:_Linux_Firewalls_Using_iptables>
- <http://www.yolinux.com/TUTORIALS/LinuxTutorialIptablesNetworkGateway.html>
iptables-restore < rules.fw
- <https://major.io/2007/02/09/delete-single-iptables-rules/>
```{=html}
<!-- -->
```
- Regeln auflisten:
```bash
iptables -L
iptables -L INPUT --line-numbers
iptables -t nat -L
iptables -D INPUT -s 127.0.0.1 -p tcp --dport 111 -j ACCEPT
```
- oder anhand der Chain Nummer: `iptables -D INPUT 4`
-
#!/bin/sh
echo "Stopping firewall and allowing everyone..."
iptables -F
iptables -X
iptables -t nat -F
iptables -t nat -X
iptables -t mangle -F
iptables -t mangle -X
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
iptables -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT
iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
iptables -A OUTPUT -p udp --dport 53 -j ACCEPT
# Now, allow connection to website serverfault.com on port 80
iptables -A OUTPUT -p tcp -d serverfault.com --dport 80 -j ACCEPT
iptables -A OUTPUT -p tcp -d serverfault.com --dport 443 -j ACCEPT
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
iptables -P INPUT DROP
iptables -P OUTPUT DROP
- <https://stackoverflow.com/questions/10727443/how-to-use-iptables-in-linux-to-forward-http-and-https-traffic-to-a-transparent>