linux - How to allow a domain name in iptables? -
i have linux server gets time offset strange reason
i set cron job run , update time using following command
/usr/sbin/ntpdate pool.ntp.org
the problem command not run because have firewall (iptables)
i have use ip allow traffic in network:
iptables -a input -p tcp -m tcp -i eth0 -s 11.11.11.11 --dport 5060 -j accept
i know how using domain name in case pool.ntp.org
or maybe tell me better way keep clocks in sync
please advice
typically, iptables setup restrict incoming tcp , udp connections initiated remote hosts server except needed. but, outgoing tcp , udp connections initiated server remote hosts allowed, , state kept replies allowed in, so:
# allow tcp/udp connections out. keep state conns out allowed in. iptables -a input -p tcp -m state --state established -j accept iptables -a output -p tcp -m state --state new,established -j accept iptables -a input -p udp -m state --state established -j accept iptables -a output -p udp -m state --state new,established -j accept
if iptables setup so, allow ntpdate make outgoing connection pool.ntp.org, , allow reply in. and, can still block down incoming connections server initiated other hosts.
Comments
Post a Comment