I have a debian server that I'm trying to set up a firewall on. I have set up my rules so that the sever is working almost right, using the rules displayed below. My main problems are that if I have the INPUT default policy to block (iptables -p INPUT DROP) I can no longer resolve domain names for some reason, and a portscan will still show other ports as open (ie 389 UDP, which is ldap). If I set the default policy to allow, the domain name resolution (named) will resolve external domains properly.
I'm fairly new to IPTABLES,and would appreciate it if someone could point out whatever I'm doing wrong.
also, I have changed SSHD over to port 2222
iptables -L
I'm fairly new to IPTABLES,and would appreciate it if someone could point out whatever I'm doing wrong.
also, I have changed SSHD over to port 2222
iptables -L
Code:
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:2222
ACCEPT tcp -- anywhere anywhere tcp dpt:ftp
ACCEPT tcp -- anywhere anywhere tcp dpt:smtp
ACCEPT tcp -- anywhere anywhere tcp dpt:pop3
ACCEPT tcp -- anywhere anywhere tcp dpt:imap2
ACCEPT tcp -- anywhere anywhere tcp dpt:www
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- localhost localhost
Chain FORWARD (policy DROP)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain