Externip + localnet + nat

Hello all,
If this issue has been addressed before I apologize but I have not found it yet.

I have an IPPBX box from a local supplier with asterisk on it and I have the following issue:
The box has two NIC’s, one for WAN and one for LAN.
On the WAN I have a line from a local provider wich works ok.
On the LAN I have a line from another provider comming through the company internet connection.
The PBX is behind a linux box that does the nat.
The problem is that on the line from the LAN I cannot hear anything, I did some mail exchange with the provider and it seems that the problem is that the call is seen with the local IP and not the internet IP. I have set up in the PBX extern IP and local net, did some tcpdump and the line on LAN is working, the authentication is made at the provider with the internet IP.
The problem is that this affects the line on the WAN as the authentication at WAN provider is made also with the company internet IP and not the IP given by the WAN provider and fails.
The final question is: is there any way of configuring the PBX to use externip and localnet only on one interface? (LAN).
Thank you.

Asterisk can only cope with one local network and one (the) internet. That means there can only be NAT on one route out.

If you are operating broken multi-homing (two external addresses that don’t know about each other, you will need to run one instance of Asterisk each. If this is your problem, it is a problem that is often asked about and a search should have found it.

Switching to PJSIP channel driver may be a solution for your issue as PJSIP supports multiple network interfaces, so that each trunk and extension can explicitly be linked to a specific interface.