P
P
p_yakovlev2022-02-23 14:38:14
linux
p_yakovlev, 2022-02-23 14:38:14

FreePBX and two network interfaces?

There is a task: FreePBX, to organize access through two network interfaces.

eth0 - local network, 190.160.80.0, connected from the LAN switch.
eth1 - provider's data channel with a sip trunk, connected directly from the provider's switch.

For successful authorization on sip, the provider requires that the ip of the device from which the connection was made is conditionally 10.10.10.9, and gw 10.10.10.10.

Since I'm doing this for the first time - zero knowledge ...

As a result:

If I configure eth0 and eth1 in FreePBX, then there is access to the web interface. However, the sip registration fails, as it knocks on the ISP using my LAN's gw (190.160.80.1) and not the ISP's gw (10.10.10.10).

How to make FreePBX register sip using gw provider. And at the same time - was it available within my local network?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Karabanov, 2022-02-23
@karabanov

Configure Multihome IPv4 Routing Rule on Linux
Create Routing Tables:

echo 100 eth0-route >>/etc/iproute2/rt_tables
echo 101 eth1-route >>/etc/iproute2/rt_tables

Customize interfaces:
auto eth0
iface eth0 inet static
    address 10.10.10.9
    netmask 255.255.255.252
    gateway 10.10.10.10
    post-up ip route add 10.10.10.9/30 dev ens19 src 10.10.10.9 table eth0-route
    post-up ip route add default via 10.10.10.10 dev eth0- table eth0-route
    post-up ip rule add from 10.10.10.9 lookup eth0-route

auto eth1
iface eth1 inet static
    address 190.160.80.2
    netmask 255.255.255.0
    post-up ip route add 190.160.80.0/24 dev eth1 scope link src 190.160.80.2 table eth1-route
    post-up ip route add default via 190.160.80.1 dev eth1 table eth1-route
    post-up ip rule add from 190.160.80.2 lookup eth1-route

Z
Zerg89, 2022-02-23
@Zerg89

Either src nat, or rewrite all devices to the required subnet

A
Andrey Barbolin, 2022-02-23
@dronmaxman

https://db-ip.com/190.160.80.0
Since when have white addresses been used on a local network...

For successful authorization on sip, the provider requires that the ip of the device from which the connection was made is conditionally 10.10.10.9, and gw 10.10.10.10.

That is, you have a direct connection to the SIP provider. Well, ok, just remove GW there and write down the necessary routes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question