Manual:Wireless VLAN Trunk: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
(Created page with "{{Versions| v6.41 +}} __TOC__ =Summary= A very common task is to forward only a certain set of VLANs over a Wireless Point-to-Point (PtP) link. Since RouterOS v6.41 this ca...")
 
 
(3 intermediate revisions by the same user not shown)
Line 7: Line 7:
A very common task is to forward only a certain set of VLANs over a Wireless Point-to-Point (PtP) link. Since RouterOS v6.41 this can be done using bridge VLAN filtering and should be used instead of any other methods (including bridging VLAN interfaces). Lets say we need to forward over a Wireless link 2 different VLANs and all other VLAN IDs should be dropped. VLAN 10 is going to be our Internet traffic while VLAN 99 is going to be for our management traffic. Below you can find the network topology:
A very common task is to forward only a certain set of VLANs over a Wireless Point-to-Point (PtP) link. Since RouterOS v6.41 this can be done using bridge VLAN filtering and should be used instead of any other methods (including bridging VLAN interfaces). Lets say we need to forward over a Wireless link 2 different VLANs and all other VLAN IDs should be dropped. VLAN 10 is going to be our Internet traffic while VLAN 99 is going to be for our management traffic. Below you can find the network topology:


FILE
[[File:Wlan trunk.png|700px|thumb|center|alt=Alt text|VLANs over PtP Wireless link]]


=Configuration=
=Configuration=


Start by creating a new bridge on '''ĀP''' and '''ST''' and add '''ether1''' and '''wlan1''' ports to it:
Start by creating a new bridge on '''AP''' and '''ST''' and add '''ether1''' and '''wlan1''' ports to it:
<pre>
<pre>
/interface bridge
/interface bridge
add name=bridge protocol-mode=none
add name=bridge protocol-mode=none
/interface bridge port
/interface bridge port
add bridge=bridge interface=sfp1
add bridge=bridge interface=ether1
add bridge=bridge interface=wlan1
add bridge=bridge interface=wlan1
</pre>
</pre>
Line 25: Line 25:
<pre>
<pre>
/interface bridge port
/interface bridge port
set [find where interface=sfp1 or interface=wlan1] frame-types=admit-only-vlan-tagged ingress-filtering=yes
set [find where interface=ether1 or interface=wlan1] frame-types=admit-only-vlan-tagged ingress-filtering=yes
</pre>
</pre>


Line 31: Line 31:
<pre>
<pre>
/interface bridge vlan
/interface bridge vlan
add bridge=bridge tagged=sfp1,wlan1 vlan-ids=10
add bridge=bridge tagged=ether1,wlan1 vlan-ids=10
add bridge=bridge tagged=sfp1,wlan1,bridge vlan-ids=99
add bridge=bridge tagged=ether1,wlan1,bridge vlan-ids=99
</pre>
</pre>


Line 45: Line 45:
</pre>
</pre>


For '''R1''' and '''Ŗ2''' do the same, but the interface, on which you need to create the VLAN interface, will probably change, depending on your setup:
For '''R1''' and '''R2''' do the same, but the interface, on which you need to create the VLAN interface, will probably change, depending on your setup:
<pre>
<pre>
/interface vlan
/interface vlan

Latest revision as of 07:00, 16 May 2018

Version.png

Applies to RouterOS: v6.41 +

Summary

A very common task is to forward only a certain set of VLANs over a Wireless Point-to-Point (PtP) link. Since RouterOS v6.41 this can be done using bridge VLAN filtering and should be used instead of any other methods (including bridging VLAN interfaces). Lets say we need to forward over a Wireless link 2 different VLANs and all other VLAN IDs should be dropped. VLAN 10 is going to be our Internet traffic while VLAN 99 is going to be for our management traffic. Below you can find the network topology:

Alt text
VLANs over PtP Wireless link

Configuration

Start by creating a new bridge on AP and ST and add ether1 and wlan1 ports to it:

/interface bridge
add name=bridge protocol-mode=none
/interface bridge port
add bridge=bridge interface=ether1
add bridge=bridge interface=wlan1
Icon-note.png

Note: You can enable RSTP if it is required, but generally RSTP is not required for PtP links since there should not be any way for a loop to occur.


For security reasons you should enable ingress-filtering, since you are expecting only tagged traffic, then you can set the bridge to filter out all untagged traffic. Do the following on AP and ST:

/interface bridge port
set [find where interface=ether1 or interface=wlan1] frame-types=admit-only-vlan-tagged ingress-filtering=yes

Set up the bridge VLAN table. Since VLAN99 is going to be our management traffic, then we need to allow this VLAN ID to be able to access the CPU, otherwise the traffic will be dropped as soon as you will try to access the device. VLAN10 does not need to access the CPU since it is only meant to be forwarded to the other end. To achieve such functionality add these entries to the bridge VLAN table on AP and ST:

/interface bridge vlan
add bridge=bridge tagged=ether1,wlan1 vlan-ids=10
add bridge=bridge tagged=ether1,wlan1,bridge vlan-ids=99
Icon-note.png

Note: You can limit from which interfaces it will be allowed to access the device. For example, if you don't want the device to be accessible from wlan1, then you can remove the interface from the corresponding bridge VLAN entry.


All devices (R1, R2, AP and ST) needs a VLAN interface created in order to be able to access the device through the specific VLAN ID. For AP and ST create the VLAN interface on top of the bridge interface and assign an IP address to it:

/interface vlan
add interface=bridge name=MGMT vlan-id=99
/ip address
add address=192.168.99.X/24 interface=MGMT

For R1 and R2 do the same, but the interface, on which you need to create the VLAN interface, will probably change, depending on your setup:

/interface vlan
add interface=ether1 name=MGMT vlan-id=99
/ip address
add address=192.168.99.X/24 interface=MGMT
Icon-note.png

Note: To allow more VLANs to be forwarded, you simply need to specify more VLAN IDs in the bridge VLAN table, you can specify multiple VLANs divided by coma or even VLAN ranges.


Setup the Wireless link on AP:

/interface wireless security-profiles
add authentication-types=wpa2-psk mode=dynamic-keys name=wlan_sec wpa2-pre-shared-key=use_a_long_password_here
/interface wireless
set wlan1 band=5ghz-a/n/ac channel-width=20/40/80mhz-Ceee disabled=no mode=bridge scan-list=5180 security-profile=wlan_sec ssid=ptp_test

Setup the Wireless link on ST:

/interface wireless security-profiles
add authentication-types=wpa2-psk mode=dynamic-keys name=wlan_sec wpa2-pre-shared-key=use_a_long_password_here
/interface wireless
set wlan1 band=5ghz-a/n/ac channel-width=20/40/80mhz-Ceee disabled=no mode=station-bridge scan-list=5180 security-profile=wlan_sec ssid=ptp_test
Icon-note.png

Note: For each type of setup there are different requirements, for PtP links NV2 wireless protocol is commonly used. You can read more about NV2 in the NV2 Manual page.


When links are set up, you can enable bridge VLAN filtering on AP and ST:

/interface bridge
set bridge vlan-filtering=yes
Icon-warn.png

Warning: Double check the bridge VLAN table before enabling VLAN filtering. Misconfigured bridge VLAN table can lead to the device being inaccessible and configuration reset might be required.


That is it!