Trunks with NAT

When i set (My local network/subnet) internet trunks stop working, without setting localnet it works fine. the error message in log file is as follows.
[Oct 12 00:43:14] NOTICE[8249] chan_sip.c: – Registration for ‘[email protected]’ timed out, trying again
when i check peers in CLI it shows as:
My PBX is behind NAT so i need to fix this issue.

FreePBX v.
Asterisk v.11.13.0

I have also tried disabling direct access to (Non-embedded) to FreePBX and doing manual configurations in sip_nat.conf / sip_custom.conf / sip_general_custom.conf. same result

Hope someone will help ASAP and thanks in advance

What re you setting local net to?

as i said ,my local network, let me give u an example.
lets assume my local network is so in conf file it will be as localnet=

NAT works fine when i do those configurations, i can dial in to my asterisk server from internet and vice-versa, the problem is when i enable those settings trunks stops working.