Page 1 of 1

Route different LANs and PBX

Posted: Wed Feb 10, 2021 12:41 pm
by GreenFirefly
Hello, I need some help with router configuration.
My IP-phones live in network 192.168.1.0/24. My PBX has address 192.168.1.1 and its default gateway is 192.168.1.254 (this is the home router connected to the Internet). Configuration works well without other settings (i.e. port forwarding etc).
Now I need add new IP-phones from the IP-network 192.168.2.0/24. This is the same physical network (I mean in the same Ethernet domain), just another IP-network is used for phones. I need somehow route 192.168.1.0 to 192.168.2.0 and backwards. Also PBX needs know how to deal with phones from LAN 192.168.2.0. How can such configuration looks like?
Have little experience with Mikrotik, so more details are appreciated.

Re: Route different LANs and PBX

Posted: Wed Feb 10, 2021 5:14 pm
by nescafe2002
Add ip address 192.168.2.x/24 to LAN interface (bridge) takes care of routing between two subnets on same interface.

/ip address
add address=192.168.2.254/24 interface=bridge network=192.168.2.0

Extend ip pool and add dhcp-network for this segment.

/ip dhcp-server network
add address=192.168.2.0/24 dns-server=192.168.2.254 gateway=192.168.2.254
/ip pool
add name=lan2 ranges=192.168.2.10-192.168.2.250
set <num> next-pool=lan2

If supported by the phones, you could use vendor class (instead of next-pool) to assign ip from new pool.

/ip dhcp-server vendor-class-id
add address-pool=lan2 name=lan2 server=default vid=<identifier>

Bridge is already member of interface list LAN so firewall should be ok.
No NAT is required, PBX should allow connections from 192.168.2.0/24.

Re: Route different LANs and PBX

Posted: Thu Feb 11, 2021 10:22 am
by GreenFirefly
Thanks for your reply.
I reset configuration on Mikrotik and did as you had written Image https://ibb.co/3mvcqK6
My PC has following settings: 192.168.1.10/24 gateway: 192.168.1.254. From it I can ping 192.168.1.254 but can't ping 192.168.2.254. Why?
Another problem concerns PBX. It is able to have only 1 network address (192.168.1.1) so it can't allow connections from 192.168.2.0/24 as I understand.

Re: Route different LANs and PBX

Posted: Thu Feb 11, 2021 11:45 am
by nescafe2002
PBX should have set 192.168.2.254 as gateway.
Not sure why you couldn't ping 192.168.2.254 from your existing lan.. could you post your config (/export hide-sensitive)?

Re: Route different LANs and PBX

Posted: Thu Feb 11, 2021 12:59 pm
by GreenFirefly
PBX should have set 192.168.2.254 as gateway.
Not sure why you couldn't ping 192.168.2.254 from your existing lan.. could you post your config (/export hide-sensitive)?
1) I got normal ping after shutting down second LAN-interface on my PC.
2) So I need to have 2 gateways on PBX: 192.168.1.254 and 192.168.2.254. But this PBX can't have such configuration - only 1 network with at least 1 gateway from that only network.
Could we leave PBX as is and configure only Mikrotik?

Re: Route different LANs and PBX

Posted: Thu Feb 11, 2021 1:53 pm
by nescafe2002
Sorry, I misguided you.. PBX should be set to gateway 192.168.1.254.

Re: Route different LANs and PBX

Posted: Thu Feb 11, 2021 1:56 pm
by GreenFirefly
I mean something like this
Image

Re: Route different LANs and PBX

Posted: Thu Feb 11, 2021 2:21 pm
by nescafe2002
Yep.. that should work.

Re: Route different LANs and PBX

Posted: Thu Feb 11, 2021 3:03 pm
by GreenFirefly
Sorry, I misguided you.. PBX should be set to gateway 192.168.1.254.
Don't work now. I'm looking at Wireshark's output from mirrored port of PBX. I can see the incoming request from the phone with address 192.168.2.100. But then reply has been sent to the router instead of the phone. Phone doesn't get the reply and shows me "Can't register" on the display.

Re: Route different LANs and PBX

Posted: Thu Feb 11, 2021 3:07 pm
by nescafe2002
Is there no relevant line in the firewall connection tracking table?

Re: Route different LANs and PBX

Posted: Fri Feb 12, 2021 9:19 am
by GreenFirefly
I was wrong. Had a mistake in wired connections. You were right - such configuration works, I'm able to call on my local phone numbers and also call through Internet.
Thak you very much for your help!

Re: Route different LANs and PBX

Posted: Fri Feb 12, 2021 11:35 am
by GreenFirefly
I've noticed a problem - when I call somebody, I can hear him but he can't hear me.

Re: Route different LANs and PBX

Posted: Fri Feb 12, 2021 3:02 pm
by GreenFirefly
Wireshark shows that phone sends packets in the wrong direction - to the provider's PBX. Right communication is shown on the picture above.
192.168.10.1 - PBX
192.168.10.218 and 192.168.11.218 - IP-phone (I'm changing this addresses on one phone for test)
83.169.220.161 - provider's PBX
192.168.10.254 - Mikrotik
Image https://ibb.co/gdGqZ9K