When the firewall is running, I cannot access my website. When I turn it off, it works.
I used these rules to redirect port 8443 to regular 443.
firewall-cmd --zone=public --permanent --direct --add-rule ipv4 nat OUTPUT 0 -p tcp -o lo --dport 443 -j REDIRECT --to-ports 8443
firewall-cmd --zone=public --permanent --direct --add-rule ipv4 nat PREROUTING 0 -p tcp --dport 443 -j REDIRECT --to-ports 8443
I don´t need them anymore (run Apache proxy). I try to delete them:
firewall-cmd --zone=public --permanent --direct --remove-rule ipv4 nat OUTPUT 0 -p tcp -o lo --dport 443 -j REDIRECT --to-ports 8443
firewall-cmd --zone=public --permanent --direct --remove-rule ipv4 nat PREROUTING 0 -p tcp --dport 443 -j REDIRECT --to-ports 8443
Rules didn´t disappear. I found them in iptables. I flushed nat iptables use the command:
iptables -t nat -F
After the flush I can connect to the website. When I restart my computer, the rules still remain and the web page is unavailable. How do I permanently delete the rules? Are the commands correct?
firewall-cmd configuration:
root@my_hostname]# firewall-cmd --list-all --zone=public
public (active)
target: default
icmp-block-inversion: no
interfaces: eth0
sources:
services: ssh https http
ports: 443/tcp 44443/tcp 8443/tcp 8081/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules: