Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

i migrate a ejabberd server to a vm with only private ip. is work fine but not connect to anothers xmmp servers.

log: s2s connection: xxxx -> gmail.com (remote server not found)

telnet test: telnet xmpp-server.l.google.com 5269 Connection time out

in the host add iptables nat port 5269 to internal ip. iptables -t nat -A PREROUTING -p tcp -m tcp --dport 5269 -j DNAT --to-destination x.x.x.x:5269

the host have a masquerade for all out to eth with public ipv4.

if i remove this nat the telnet test is ok, but i cant connect to port 5269 on internal ip.

Any ideas?


share|improve this question
JAaaa just fixed!! :D the problem if with nat rule... only add interface with public ip for nat: iptables -t nat -A PREROUTING -i ETHERNET_WITH_PUBLIC_IP -p tcp -m tcp --dport 5269 -j DNAT --to-destination x.x.x.x:5269 Sorry i dont have perm for public answer to my own questions :P "Oops! Your answer couldn't be submitted because: Users with less than 10 reputation can't answer their own question for 8 hours after asking. You may self-answer in 7 hours. Until then please use comments, or edit your question instead." –  bl4ckb1rd Dec 12 '12 at 12:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.