Community discussions

MikroTik App
 
GreenFirefly
just joined
Topic Author
Posts: 8
Joined: Tue Dec 11, 2018 12:55 pm

Route different LANs and PBX

Wed Feb 10, 2021 12:41 pm

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.
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 758
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Route different LANs and PBX

Wed Feb 10, 2021 5:14 pm

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.
 
GreenFirefly
just joined
Topic Author
Posts: 8
Joined: Tue Dec 11, 2018 12:55 pm

Re: Route different LANs and PBX

Thu Feb 11, 2021 10:22 am

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.
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 758
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Route different LANs and PBX

Thu Feb 11, 2021 11:45 am

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)?
 
GreenFirefly
just joined
Topic Author
Posts: 8
Joined: Tue Dec 11, 2018 12:55 pm

Re: Route different LANs and PBX

Thu Feb 11, 2021 12:59 pm

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?
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 758
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Route different LANs and PBX

Thu Feb 11, 2021 1:53 pm

Sorry, I misguided you.. PBX should be set to gateway 192.168.1.254.
 
GreenFirefly
just joined
Topic Author
Posts: 8
Joined: Tue Dec 11, 2018 12:55 pm

Re: Route different LANs and PBX

Thu Feb 11, 2021 1:56 pm

I mean something like this
Image
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 758
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Route different LANs and PBX

Thu Feb 11, 2021 2:21 pm

Yep.. that should work.
 
GreenFirefly
just joined
Topic Author
Posts: 8
Joined: Tue Dec 11, 2018 12:55 pm

Re: Route different LANs and PBX

Thu Feb 11, 2021 3:03 pm

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.
 
nescafe2002
Forum Veteran
Forum Veteran
Posts: 758
Joined: Tue Aug 11, 2015 12:46 pm
Location: Netherlands

Re: Route different LANs and PBX

Thu Feb 11, 2021 3:07 pm

Is there no relevant line in the firewall connection tracking table?
 
GreenFirefly
just joined
Topic Author
Posts: 8
Joined: Tue Dec 11, 2018 12:55 pm

Re: Route different LANs and PBX

Fri Feb 12, 2021 9:19 am

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!
 
GreenFirefly
just joined
Topic Author
Posts: 8
Joined: Tue Dec 11, 2018 12:55 pm

Re: Route different LANs and PBX

Fri Feb 12, 2021 11:35 am

I've noticed a problem - when I call somebody, I can hear him but he can't hear me.
 
GreenFirefly
just joined
Topic Author
Posts: 8
Joined: Tue Dec 11, 2018 12:55 pm

Re: Route different LANs and PBX

Fri Feb 12, 2021 3:02 pm

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

Who is online

Users browsing this forum: mommish and 46 guests