Block port 111 from outside

Block port 111 from outside

Somehow my server opens port 111, i don’t have time to investigate which program is opening that port, my quick fix was to block that port from external

/sbin/iptables -A INPUT -p tcp --destination-port 111 -j DROP
/sbin/iptables -A INPUT -p udp --destination-port 111 -j DROP

#remember to save your iptables config 
iptables-save > /etc/iptables.conf
#and restore it when your machine restarts
iptables-resotre </etc/iptables.conf

Leave a Reply

Your email address will not be published. Required fields are marked *