I have a CentOS 7 image on VM VirtualBox (bridged Ethernet with static IP) I was trying to set iptables
filter table but I have the following problems:
Whatever I did to open Apache on port 80 doesn't work (instead if I stop iptables service I can load web pages without any problem). I found somewhere that a possible solution could be to write a rule to enable bridge. Is it true? Anyway I can't find any bridge configuration in the machine.
I deleted default rule for port 22 and now I can't even login from SSH, even if I think I restored it.
This is the iptables file:
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p tcp -m tcp --dport 10000 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A INPUT -j ACCEPT
-A INPUT -p tcp -m tcp --sport 137:139 --dport 137:139 -j ACCEPT
-A INPUT -p tcp -m tcp -m multiport --ports 445 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 22 -j ACCEPT
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
*mangle
:PREROUTING ACCEPT [48:5579]
:INPUT ACCEPT [47:5507]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [39:4446]
:POSTROUTING ACCEPT [54:7320]
COMMIT
*nat
:PREROUTING ACCEPT [23:1557]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [7:548]
:POSTROUTING ACCEPT [7:548]
COMMIT