{"id":1011,"date":"2017-12-20T16:28:15","date_gmt":"2017-12-20T19:28:15","guid":{"rendered":"http:\/\/blog.abratel.com.br\/?p=1011"},"modified":"2018-12-12T22:40:47","modified_gmt":"2018-12-13T01:40:47","slug":"hairpin-nat-reflection-mode-for-port-forwards-iptables-solution","status":"publish","type":"post","link":"https:\/\/blog.abratel.com.br\/?p=1011","title":{"rendered":"Hairpin NAT Reflection mode for port forwards &#8211; iptables solution"},"content":{"rendered":"<p>A.A.A.A is your real ip<br \/>\n192.168.254.0\/24 &#8211; LAN Network<br \/>\neth0 &#8211; Interface LAN<br \/>\nPort 4569 udp &#8211; service IAX<\/p>\n<p>When the server linux is the gateway and the same time is the asterisk server (ipbx)<\/p>\n<pre class=\"brush: bash; title: ; notranslate\" title=\"\">\r\n[root@jupiter ~]# iptables -t nat -I PREROUTING -d A.A.A.A -p udp --dport 4569 -j DNAT --to 127.0.0.1:4569\r\n[root@jupiter ~]# iptables -t nat -A POSTROUTING -o eth0 -s 192.168.254.0\/24 -d 127.0.0.1 -p udp --dport 4569 -j MASQUERADE\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>A.A.A.A is your real ip 192.168.254.0\/24 &#8211; LAN Network eth0 &#8211; Interface LAN Port 4569 udp &#8211; service IAX When the server linux is the gateway and the same time is the asterisk server (ipbx)<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/1011"}],"collection":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1011"}],"version-history":[{"count":2,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions"}],"predecessor-version":[{"id":1084,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=\/wp\/v2\/posts\/1011\/revisions\/1084"}],"wp:attachment":[{"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1011"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1011"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.abratel.com.br\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1011"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}