Remove "Flush exiting rules" and "Set default policies" from

iptables_init.sh
This commit is contained in:
Reza Behzadan 2025-02-20 14:57:22 -05:00
parent 11585765d1
commit e630b0c0e0

View File

@ -1,19 +1,5 @@
#!/bin/bash
# Flush existing rules
iptables -F
ip6tables -F
iptables -t nat -F
ip6tables -t nat -F
# Set default policies
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT
ip6tables -P INPUT ACCEPT
ip6tables -P FORWARD ACCEPT
ip6tables -P OUTPUT ACCEPT
# Apply IPv4 rules
iptables -t nat -A PREROUTING -i enX0 -p tcp --dport 443 -j REDIRECT --to-ports 4443
iptables -t nat -A PREROUTING -i enX0 -p tcp --dport 80 -j REDIRECT --to-ports 4443