I am having problem opening port 53 on my centos machine, for DNS configuration.
Here is my iptables config
-A INPUT -p udp -m udp --sport 53 -j ACCEPT
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
When I ran a nmap scan of the machine only port 80 showed up as open on it. Am I missing anything?
EDIT:
Full iptable
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -p udp -m state --state NEW,ESTABLISHED -m udp --dport 53 -j ACCEPT
-A INPUT -p udp -m udp --sport 53 -j ACCEPT
-A INPUT -p tcp -m state --state NEW --state NEW -m tcp --dport 80 -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 -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT -reject-with icmp-host-prohibited
-A FORWARD -j REJECT -reject-with icmp-host-prohibited
-A OUTPUT -p udp -m udp --dport 53 -j ACCEPT
COMMIT
nmap
command line you used?iptables --list
would be handy to see. You'll also want to disable the firewall insystem-config-firewall-tui
(or in your gui), so that you can manually set it with iptables commands, otherwise, it will re-write your iptables if you use that. Bonus tip, in centos (at least) you can do aservice iptables save
when you're done, so the changes stick for the next reboot.nmap -sU -p 53 $host