Trunks with NAT

When i set localnet=xxx.xxx.xxx.xxx/xxx.xxx.xxx.xxx (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:
TRUNKNAME/MYDID 195.189.XXX.XXX Yes Yes 5060 UNREACHABLE
.
My PBX is behind NAT so i need to fix this issue.

Using:
FreePBX v.2.8.1.4
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 192.168.0.0./24. so in conf file it will be as localnet=192.168.0.0/255.255.255.0

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.