Assistance with Trunk Registration

Hello everyone, I have been working on this for several days and am stumped at this point…

My environment is:

  • FreePBX installed on VM (VMWare ESXI Host)
  • SipStation Trunks (used auto-config key code to setup)
  • CentOS-based Firewall
  • Dual Wan:
  1. ppp0 - static with multiple IPs (low-bandwidth)
  2. eth0 - dynamic cable connection (tons of bandwidth)
  • traffic nat’ed via iptables (for vm in question)
  • all 5060 traffic is routed through static wan interface, as well as all traffic from pbx internal ip (note: routed both just as a failsafe)
  • “Asterisk Sip Settings” in freepbx gui set to NAT with static IP and internal network defined

I am trying to build an environment to host multiple FreePBX systems on VMWare ESXI box and have been having all kinds of issues, but at this point I think there may be something corrupt in freepbx or some networking nuance I am missing. I have set up several installs in similar environments and always did a 1-1 NAT to an available static IP from the internal IP. That has worked 100% of the time using the same exact firewall setup in all my other installs and it works in my current environment as well for one of my other FreePBX installs. The problem is that on this particular FreePBX install I am trying to avoid a 1-1 NAT setup so that later I can configure more than one system on the same ip and just nat different ports based on the host. What I am seeing now in FreePBX gui under Connectivity > SipStation, is the secondary trunk is registered but shows extern-ip of eth0 and contact ip of ppp0 (it should be ppp0) and the primary trunk shows contact ip and network ip of ppp0 connection like it should. On my firewall, eth0 is the “primary” interface but with nat rules set and if ONE trunk is registering via correct interface my firewall would not just consistently decide to send all requests for trunk2 registration out a different interface. That just doesn’t make sense. I have rebooted and re-applied config several times just to make sure it took and had a chance to register again, but the secondary trunk still shows external-IP of eth0 under network IP. I am at a loss here… and any help would be greatly appreciated.

**On a side note, I was originally trying to get this to work using my dynamic connection and a dynamic host-name (I have one setup already) but switched to using the static connection to make it a bit cleaner for troubleshooting. My end goal is still to get it working on the dynamic cable connection. If anyone feels extra generous with their time or knows how to make that work instead of just getting it working on the ppp0 connection that would be awesome :slight_smile: but seriously, any direction or help to get it working correctly on even the ppp0 connection would be much appreciated.

Thanks in advance!

You can’t configure one to many NAT. RTP uses random ports (that’s just one reason).

eSXI is a crappy environment to do this in.

Try Proxmox, only use KVM mode.

If you really want to be in the service resell business you should take a look at PBXtended, Schmooze’s commercial hosting platform. Centrally managed, provisioned from a single portal and with an API.