Hairpin NAT Reflection mode for port forwards – iptables solution

A.A.A.A is your real ip
192.168.254.0/24 – LAN Network
eth0 – Interface LAN
Port 4569 udp – service IAX

When the server linux is the gateway and the same time is the asterisk server (ipbx)

[root@jupiter ~]# iptables -t nat -I PREROUTING -d A.A.A.A -p udp --dport 4569 -j DNAT --to 127.0.0.1:4569
[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

Deixe uma resposta