Trunk Access Two Different Routers

Good afternoon,

Bare with me on this one.

My provider gives me two routers which give me two numbers with two different Internet packages.
Say the 1st one is 22xxxxxx10 and the 2nd one 22xxxxxx11.

The provider doesn’t split the lines from one router they come from two separate routers as you see.

Both routers have the same gateway 192.168.1.1

Respectively i get two sets of sip credentials from both lines.
1st lets say [email protected] with its password and the 2nd say [email protected] with its password.

My goal is to add them both to the FreePBX as trunks.

If i try to use via one router and keep the other out only one account registers and the other fails as it kinda makes sense.

My question is as follows, can this be achieved with only one NIC say to create a sub interface and if so what are the routing steps?

If i add a second NIC and add the second router there will that solve my issue or more routing is needed there also?

Thank you for your time

No I can’t see why [email protected] and [email protected] should be considered as two separate routers if both arrive on 192.168.1.1, what physical ‘routers’ do they provide you with?

1 Like

ports

Sorry i didn’t say it right, My bad, the gateway is for the end user, 192.168.1.0/24 gateway 192.168.1.1 two separate Internet and telephone lines (VDSL) lines.

Two SpeedPort Plus routers each one has its own public ip from the provider.

If i try to register the second routers sip credentials via the first one it shows unregistered. They are not registered at the same time.

So, they are not actually ‘trunks’ but ‘lines’, can you have them send your two DID’s to “line 1” and “line 2” on one ATA ? if not you will need two interfaces each NAT’ing to your LAN (which for ease of setup shouldn’t be 192.168.1.0/24)

1 Like

No they don’t, so what i have to do is use two NIC’s, use different ranges on both line routers say 192.168.1.0/24 and 192.168.2.0/24 and NAT to say network of the PBX?

I think we need a network diagram.

1 Like

I’m not sure how that is going to help. The ISP provided the OP with combo devices that have their Internet and their voice service on it. We need to understand the voice service setup with the ISP.

When the OP states that they can register one account but not the other, are they registering to 192.168.1.1 or are they registering to the public facing voice services?

Are the two accounts considered separate lines? Is this just basically two POTS style services and the ISP’s expectation is plugging into the FXS ports on their devices?

But outside of all that, there is two separate Internet connections, each router is programmed with the same LAN subnets and most likely has DHCP services set on on them. Meaning each router is going to give out the 192.168.1.1 as the gateway and an address from the 192.168.1.0/24 subnet.

So that means for the PBX to send Internet traffic to Router A it needs to route it to 192.168.1.1 as the gateway to the Internet. If the PBX wants to send traffic to Router B it needs to route it to 192.168.1.1 which is where the issue becomes. Can’t have two routes that are the same, one will always be used and since it’s over the same NIC…where’s it going? A switch?

As I said this is sounding like two ISP packages that have voice services bundled in with the expectation analog phones plug into the FXS ports of the router. At this point the OP would need to change the LAN subnet on one of the routers and then do some networking mojo with the routes. Might even require there being two IPs on the PBX with a transport each and if traffic sources for 192.168.1.3 send it to Router A and if it sources from 192.168.1.5, send it to Router B.

1 Like

I am planning to do this as you describe as they are two separate internet connections with their own dhcp services, so i am planning to load balance them via a mikrotik router whilst changing the second routers ip range and change the transport with a sub interface.

Will see how it goes and post the results

So you’re going to double NAT everything?

1 Like

I found a manual at
https://help.cosmote.gr/system/templates/selfservice/gnosis/files3/Speedport_Plus_User_Manual_eng.pdf

Is that the right one for you system? If so, on page 54, it says “Set the hook at the PPPoE pass-through. When this is enabled, the LAN/Wi-Fi devices can initiate PPPoE sessions.” If true, you can at least have the Mikrotik do the PPPoE, so it will get public IP addresses and you won’t have any double NAT issues.

But it’s possible that an external device can do PPPoE in addition to the router itself (each account can have two public IPv4 addresses), in which case you won’t need the Mikrotik (except possibly for load balancing unrelated to the PBX), because the PBX could get its own public IP address from each router.

1 Like

If you can get them into ‘DMZ mode’ then using two LAN interfaces on a mikrotik doing NAT forwarding ‘everything’ should work fine if you have the SIP credentials,

If you have the PPoE credentials and the device in ‘bridge mode’ then perhaps you can just use mikrotik’s PPPoE connector, this would also allow use of both ‘bandwidths’

1 Like

Good afternoon,

thank you all for your answers,

i have both the sip credentials and pppoe dial passwords and users, i will add them both on the tik and do the appropriate routing then on the freepbx i will add a subinterface and choose each transport for its own ip on the trunk part of the config.

One thing i am not sure is what to do with the transport on the extensions side.

The transport on the A Leg will depend on what is supported by the carrier, I suggest you start with UDP:5060, Asterisk is a B2BUA so will trans-code as necessary the B leg

1 Like

Then it is critical that the router be in ‘bridged’ mode for any of that to work

1 Like

Good afternoon,

Added both my routers as pppoe passthrough on the mikrotik router.

Added a subinterface and i routed the specific ip to go via router 2 (with a different subnet) whilst the other one to go via router 1.

As I said this is sounding like two ISP packages that have voice services bundled in with the expectation analog phones plug into the FXS ports of the router. At this point the OP would need to change the LAN subnet on one of the routers and then do some networking mojo with the routes. Might even require there being two IPs on the PBX with a transport each and if traffic sources for 192.168.1.3 send it to Router A and if it sources from 192.168.1.5, send it to Router B.

As Blaze stated as well.

Everything worked fine and without a problem.

Thank you all very much for your time

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.