Elastix server is at 76.79.56.227, and the customer’s PBX is at
10.1.132.7. Connectivity between sites is managed via SmartRouter L2TP
VPN connections. On the customer side, there is a route saying
76.79.56.227 lives on the VPN, not across the public internet. This
allows full intercommunication between servers without any NAT, which is
imperative.
That all said, here are my settings — On the Yeastar MyPBX side:
And then the Elastix side:
Note this is all being done without any username or password. This
is because EACH SIDE trusts the IP address of the other. This technique
could not be used securely with a dynamic IP address on either side.
Now that the trunk is there, I need to set up routing. I’m going to
have each side have a prefix to route calls to extensions on the other
side. In my case, users of the Elastix public server can dial 132 + any
3-digit extension on the MyPBX. Putting the “132” in the “prefix” box
instructs Elastix to strip the 132 off the number before sending it to
the trunk. This makes MyPBX just see an extension number when it rings
in, which is exactly what I want.
And, this wasn’t really necessary, but I figured I’d let the users of
the MyPBX system call users off the public server while I was at it.
In this case, I’m going to have them dial 555 + any four digit
extension for users off the Elastix server:
Creating a Point to Point (P2P) link using MikroTik Equipment
This tutorial / guide will walk you through setting up a point to point (P2P) link between two MikroTik RouterOS devices. Both devices must have a wireless interface, an ethernet interface and sufficient antenna gains and direction for whatever link distance you are trying to establish. The RBSXT devices are ideal for this type of setup as they have a high gain directional antenna. Personally I have used these devices with good line of sight to achieve real world throughput of about 20mbps TCP traffic (one way) at a distance of 8km. MikroTik do manufacture other devices which are capable of a lot more, but the devices I used were the SXT Lite2 and are only about AUD$55 each.Let’s get to it.
- We’ll start with the access point side of this setup, or rather the side that is going to set the SSID, security, channel etc. So start by plugging that in and connecting to it through Winbox or SSH. We’re going to be using Winbox screenshots throughout most of this as Winbox is usually easier to use to visualize what is happening and for those who haven’t done much work with MikroTik before.
- After you’re connected up
via Winbox, create a new bridge interface by clicking on Bridge on the
left hand menu, selecting the Bridge tab and then clicking the plus
symbol. You’ll want to give it a name, in this case bridge1 is fine
(default when there are no bridges)
- After
creating the bridge interface, we will want to create an Ethernet over
IP interface. The EoIP interface tunnelling is a MikroTik RouterOS
protocol that creates an ethernet tunnel between two routers on top of
an IP connection. This is what allows us to bridge all traffic across
the link just as if there were a physical Ethernet interface and cable
between the two wireless devices. Go to Interfaces in the menu, select
the Interface tab and click the blue plus symbol. Select EoIP Tunnel at
the top and then fill out some details. You can leave the name as
eoip-tunnel1 if you like.
Set MTU to 1500
Set Remote Address to 10.8.8.2
Uncheck ‘Clamp TCP MSS’
- Once
that is done, we will want to bridge together a physical ethernet port
on our router/wireless MikroTik device and the EoIP tunnel interface for
your point to point link. Click on Bridge, select the Ports tab and
then click the blue plus symbol. Interface will be eoip-tunnel1 as
created in the last step and bridge will be bridge1 as we set earlier.
Click OK.
- Let’s do the exact same thing we did in Step 4, except choose ether1 (or whatever ethernet port you want to connect to the other end) in the interface list, and bridge1 in the bridge list. Click OK.
- Next
we will set a firewall rule. Click on IP -> Firewall in the menu and
then select the Mangle tab. Click the blue plus symbol for a new rule
and select ‘input’ as the Chain. Click on the Action tab and then set
the following:
Action = set priority
New Priority = from dscp
Click OK
- Let’s
add in some IP addresses now. Head to IP -> Addresses in the menu
and click on the blue plus symbol. We’re going to set the IP address of
this wlan interface to 10.8.8.1/30 (similarly how we set the remote
address to 10.8.8.2 in Step 3 as that will be at the other end). Click
OK and then click the blue plus symbol again and set the IP address of
the bridge1 interface. This can be whatever you please and will be the
address the router responds to when you are connected to either end of
the network via LAN. An example address is below
- Now
we will setup the wireless interface. Head to Interfaces in the menu
and choose the Interface tab. Select the wireless interface you want to
use to create the point to point link and double click on it. Click on
Advanced Mode in the sidebar and set the following settings. Please note
the following:
Radio name will generally be the mac address of your radio, you can leave this as it
SSID can be set to whatever you like, we use gate-link in this example but please remember it for the other end
Frequency can be set to whatever you like (pertaining to your countries laws), we use 2472 in this example but please remember it for the other end
Mode must be bridge
Choose a 20/40MHz HT Above Channel Width for good performance. You can tinker with these later.
Country should be set to your country
Please set the Antenna Gain to that of the antenna you are using, so you do not exceed your countries power limits
Wireless protocol should be nv2
- Click
on the ‘NV2′ tab at the top so that we can set a password. Set the
Preshared key to whatever you like (remember this for later) and click
OK.
- OK! Now we are all setup on the AP side for our point to point link. Let’s head over to the station side (the other end of the link) and fire up that router. Connect into it via Winbox and we will repeat a lot of the steps we have gone through here.
- After you’re connected up via
Winbox, create a new bridge interface by clicking on Bridge on the left
hand menu, selecting the Bridge tab and then clicking the plus symbol.
You’ll want to give it a name, in this case bridge1 is fine (default
when there are no bridges)
- After
creating the bridge interface, we will want to create an Ethernet over
IP interface like we did earlier. Go to Interfaces in the menu, select
the Interface tab and click the blue plus symbol. Select EoIP Tunnel at
the top and then fill out some details. You can leave the name as
eoip-tunnel1 if you like.
Set MTU to 1500
Set Remote Address to 10.8.8.1
Uncheck ‘Clamp TCP MSS’
- Once that is done, we will want to bridge together a physical ethernet port on our router/wireless MikroTik device and the EoIP tunnel interface. Click on Bridge, select the Ports tab and then click the blue plus symbol. Interface will be eoip-tunnel1 as created in the last step and bridge will be bridge1 as we set earlier. Click OK.
- Let’s do the exact same thing we did in Step 13, except choose ether1 (or whatever ethernet port you want to connect to the other end) in the interface list, and bridge1 in the bridge list. Click OK.
- Next we will set
a firewall rule for the point to point. Click on IP -> Firewall in
the menu and then select the Mangle tab. Click the blue plus symbol for a
new rule and select ‘input’ as the Chain. Click on the Action tab and
then set the following:
Action = set priority
New Priority = from dscp
Click OK
- Let’s
add in some IP addresses now. Head to IP -> Addresses in the menu
and click on the blue plus symbol. We’re going to set the IP address of
this wlan interface to 10.8.8.2/30 (similarly how we set the remote
address to 10.8.8.1 in Step 12 as that will be at the other end). Click
OK and then click the blue plus symbol again and set the IP address of
the bridge1 interface. This can be whatever you please and will be the
address the router responds to when you are connected to either end of
the network via LAN. An example address is below
- Now
we will setup the wireless interface for your point to point link. Head
to Interfaces in the menu and choose the Interface tab. Select the
wireless interface you want to use to receive the point to point link
and double click on it. Click on Advanced Mode in the sidebar and set
the following settings. Please note the following:
Radio name will generally be the mac address of your radio, you can leave this as it
SSID must be the same as you set at the other end in Step 8.
Frequency can be set to whatever you like (pertaining to your countries laws), we use 2472 in this example. This needs to be the same as you set in Step 8.
Mode must be station
Choose a 20/40MHz HT Above Channel Width for good performance. You can tinker with these later. This needs to be the same as you set in Step 8.
Country should be set to your country
Please set the Antenna Gain to that of the antenna you are using, so you do not exceed your countries power limits
Wireless protocol should be nv2
- Click
on the ‘NV2′ tab at the top so that we can set the password we used
before. Set the Preshared key to the same as in Step 9 and click OK.
- OK! Now we are all setup on the client or station side. Everything should be good to go if you plugin both routers and point them at each other (depending on your antenna types).