Community discussions

MikroTik App
 
oguruma
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 83
Joined: Sat Jun 04, 2022 8:55 pm

3CX firewall checker failing with Mikrotik

Tue Sep 05, 2023 3:34 am

I'm in the process of switching from a PfSense router to an RB5009. I have a single fiber WAN with a single dynamic IP. 3CX works and Firewall Checker passes with the pFsense router.

Ether5 is in a bridge called bridge-dmz at 10.1.1.0/24. The 3CX server's IP is 10.1.1.20.

I followed the guide on the 3CX website with the following commands. I also disabled the SLP ALG service port.

ip firewall nat add chain=dstnat action=dst-nat to-addresses=10.1.1.20 to-ports=5001 protocol=tcp dst-port=5001 comment="3CX Presence and Provisioning HTTPS"


ip firewall nat add chain=dstnat action=dst-nat to-addresses=10.1.1.20 to-ports=5060 protocol=udp dst-port=5060 comment="3CX SIP UDP"
ip firewall nat add chain=dstnat action=dst-nat to-addresses=10.1.1.20 to-ports=5060 protocol=tcp dst-port=5060 comment="3CX SIP TCP"
ip firewall nat add chain=dstnat action=dst-nat to-addresses=10.1.1.20 to-ports=5061 protocol=tcp dst-port=5061 comment="3CX SIP TLS"
ip firewall nat add chain=dstnat action=dst-nat to-addresses=10.1.1.20 to-ports=9000-10999 protocol=udp dst-port=9000-10999 comment="3CX Media UDP"
ip firewall nat add chain=dstnat action=dst-nat to-addresses=10.1.1.20 to-ports=5090 protocol=tcp dst-port=5090 comment="3CX Tunnel TCP"
ip firewall nat add chain=dstnat action=dst-nat to-addresses=10.1.1.20 to-ports=5090 protocol=udp dst-port=5090 comment="3CX Tunnel UDP"

ip firewall filter add chain=input action=accept connection-state=established
ip firewall filter add chain=input action=accept connection-state=related
ip firewall filter add chain=forward action=accept connection-state=established
ip firewall filter add chain=forward action=accept connection-state=related
ip firewall filter add chain=forward action=drop connection-state=invalid
ip firewall filter add chain=input action=drop in-interface=ether1
ip firewall nat add chain=srcnat action=masquerade out-interface=ether1


The only other rules I have added are NAT rules for my web server.

Has anybody ever configured an MT router for 3CX before?
You do not have the required permissions to view the files attached to this post.
 
User avatar
anav
Forum Guru
Forum Guru
Posts: 22320
Joined: Sun Feb 18, 2018 11:28 pm
Location: Nova Scotia, Canada
Contact:

Re: 3CX firewall checker failing with Mikrotik

Tue Sep 05, 2023 7:13 am

Dont know about 3CX but your rules shown are on the crappy side.
In any case without evidence full config, any comment is not all that useful.
/export file=anynameyouwish (minus router serial number, public wanip information, long list of dhcp leases )
 
User avatar
MickeyT
Member Candidate
Member Candidate
Posts: 141
Joined: Tue Feb 18, 2020 7:06 am
Location: Australia

Re: 3CX firewall checker failing with Mikrotik

Wed Sep 06, 2023 11:54 am

Ether5 is in a bridge called bridge-dmz at 10.1.1.0/24. The 3CX server's IP is 10.1.1.20.

The only other rules I have added are NAT rules for my web server.

Has anybody ever configured an MT router for 3CX before?

Yes, I've used MikroTik routers with 3CX and they work very well together (once you've got all the rules configured correctly). I have several questions about your setup:

  1. Have you assigned an IP to the ether5 interface (e.g.: 10.1.1.1),
  2. Do you have DHCP running for your DMZ bridge, and
  3. Does the 3CX server have a static IP and, if so, have you configured the gateway correctly,
  4. Can you ping an outside address from your 3CX server?

--
Backups are your friend. Always make a backup!
/system backup save encryption=aes-sha256 name=MyBackup

Please, export and attach your current config to your post if you want help with a config issue:

RouterOS v6 code

/export hide-sensitive file=MyConfig

RouterOS v7 code

/export file=MyConfig
 
oguruma
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 83
Joined: Sat Jun 04, 2022 8:55 pm

Re: 3CX firewall checker failing with Mikrotik

Wed Sep 06, 2023 7:42 pm

1) Yes, ether5 is 10.1.1.1/24
2) Yes, the bridge is serving DHCP
3) Yes the 3CX box has a static private IP of 10.1.1.20.
-What do you mean by gateway? If you mean a PSTN gateway, I'm not using one.
4) Yes, I can ping by both IP address and domain name out to the internet (8.8.8.8 and google.com, for example).
 
User avatar
MickeyT
Member Candidate
Member Candidate
Posts: 141
Joined: Tue Feb 18, 2020 7:06 am
Location: Australia

Re: 3CX firewall checker failing with Mikrotik

Fri Sep 08, 2023 11:16 am

In this case, gateway means Internet gateway and refers to the IP address of your router. To see the setting use the following command:

On Windows: PowerShell or Command prompt
ipconfig

On Linux: command prompt (bash shell or terminal)
more /etc/network/interfaces

You will see something similar to one of these screenshots.
network-info-windows-ipconfig.png
network-info-linux-interfaces.png

Does you MikroTik connect directly to the Internet (i.e.: The IP on ether1 is Internet addressable). Please attach your MikroTik config (see below for details on how to get that if you don't already know) so that we can give you more detailed help.

--
Backups are your friend. Always make a backup!
/system backup save encryption=aes-sha256 name=MyBackup

Please, export and attach your current config to your post if you want help with a config issue:

RouterOS v6 code

/export hide-sensitive file=MyConfig

RouterOS v7 code

/export file=MyConfig
You do not have the required permissions to view the files attached to this post.