Difference between revisions of "Manual:VLANs on Wireless"

From MikroTik Wiki
Jump to navigation Jump to search
Line 2: Line 2:




===Summary===
==Summary==


abc.
Configuration examples for VLAN cooperation with wireless interface features.


====Example 1====
===Example 1===
===Router1 configuration===
 
'''R1:'''
* Add necessary VLAN interfaces on ethernet interface to make it as a VLAN trunk port. Add ip addresses on VLAN interfaces.
* Add necessary VLAN interfaces on ethernet interface to make it as a VLAN trunk port. Add ip addresses on VLAN interfaces.


Line 21: Line 22:
</pre>
</pre>


===Router2 configuration===
'''R2:'''
* Add VirtualAP under wlan1 interface. ( Also create wireless security-profiles for wlan1 and wlan2)
* Add VirtualAP under wlan1 interface. (Also create wireless security-profiles for wlan1 and wlan2)


<pre>
<pre>
[admin@R2] >
[admin@R2] >
/interface wireless
/interface wireless
set [ find default-name=wlan1 ] disabled=no mode=ap-bridge security-profile=vlan110 ssid=vlan110 vlan-id=110 wireless-protocol=802.11
set [ find default-name=wlan1 ] disabled=no mode=ap-bridge security-profile=vlan110 ssid=vlan110
add disabled=no keepalive-frames=disabled master-interface=wlan1 multicast-buffering=disabled name=wlan2 \
add disabled=no master-interface=wlan1 name=wlan2 security-profile=vlan220 ssid=vlan220
    security-profile=vlan220 ssid=vlan220 vlan-id=220 wds-cost-range=0 wds-default-cost=0
</pre>
</pre>


Line 53: Line 53:
</pre>
</pre>


===Router3 configuration===
'''R3:'''
* Add ip address on wlan1 interface.  
* Add ip address on wlan1 interface.  
* Create wireless security-profile compatible with R2 wlan1.
* Create wireless security-profile compatible with R2 wlan1.
Line 62: Line 62:


/interface wireless
/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan110 wireless-protocol=802.11
set [ find default-name=wlan1 ] disabled=no security-profile=vlan110
</pre>
</pre>


===Router4 configuration===
'''R4:'''
* Add ip address on wlan1 interface.  
* Add ip address on wlan1 interface.  
* Create wireless security-profile compatible with R2 wlan2.
* Create wireless security-profile compatible with R2 wlan2.
Line 71: Line 71:
[admin@R4] >
[admin@R4] >
/ip address
/ip address
add address=172.168.1.4/24 interface=wlan1 network=192.168.1.0
add address=172.168.1.4/24 interface=wlan1 network=172.168.1.0


/interface wireless
/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan220 wireless-protocol=802.11
set [ find default-name=wlan1 ] disabled=no security-profile=vlan220
</pre>
</pre>


===Example 2===
===Example 2===


'''R1:'''
* Add necessary VLAN interfaces on ethernet interface to make it as a VLAN trunk port. Add ip addresses on VLAN interfaces.
<pre>
[admin@R1] >
/interface vlan
add interface=ether1 name=vlan110 vlan-id=110
add interface=ether1 name=vlan220 vlan-id=220
/ip address
add address=192.168.1.1/24 interface=vlan110 network=192.168.1.0
add address=172.168.1.1/24 interface=vlan220 network=172.168.1.0
</pre>
'''R2:'''
* Add VirtualAP under wlan1 interface. (Also create wireless security-profiles for wlan1 and wlan2)
<pre>
[admin@R2] >
/interface wireless
set [ find default-name=wlan1 ] disabled=no mode=ap-bridge security-profile=vlan110 ssid=vlan110 vlan-id=110 vlan-mode=use-tag
add disabled=no master-interface=wlan1 name=wlan2 security-profile=vlan220 ssid=vlan220 vlan-id=220 vlan-mode=use-tag
</pre>
{{Note | It is important to set wlan1,wlan2 vlan-mode to "use-tag".}}
* Add necessary VLAN interfaces on ethernet,wlan1,wlan2 interfaces.
* Add bridge for VLAN interfaces.
* Add all VLAN interfaces to bridge1.
<pre>
[admin@R2] >
/interface vlan
add interface=ether1 name=vlan110-ether1 vlan-id=110
add interface=ether1 name=vlan220-ether1 vlan-id=220
/interface bridge
add name=bridge1


{{cont}}
/interface bridge port
add bridge=bridge1 interface=vlan110-wlan1
add bridge=bridge1 interface=vlan220-wlan2
add bridge=bridge1 interface=vlan110-ether1
add bridge=bridge1 interface=vlan220-ether1
</pre>


[[Category:Manual]]
'''R3:'''
[[Category:Interface|Switch Chip Features]]
* Add ip address on wlan1 interface.
[[Category:Case Studies|Switch Chip Features]]
* Create wireless security-profile compatible with R2 wlan1.
[[Category:Routerboard|Switch Chip Features]]
<pre>
[admin@R3] >
/ip address
add address=192.168.1.3/24 interface=wlan1 network=192.168.1.0
 
/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan110
</pre>
 
'''R4:'''
* Add ip address on wlan1 interface.
* Create wireless security-profile compatible with R2 wlan2.
<pre>
[admin@R4] >
/ip address
add address=172.168.1.4/24 interface=wlan1 network=172.168.1.0
 
/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan220
</pre>

Revision as of 13:25, 10 January 2017


Summary

Configuration examples for VLAN cooperation with wireless interface features.

Example 1

R1:

  • Add necessary VLAN interfaces on ethernet interface to make it as a VLAN trunk port. Add ip addresses on VLAN interfaces.
[admin@R1] >
/interface vlan
add interface=ether1 name=vlan110 vlan-id=110
add interface=ether1 name=vlan220 vlan-id=220

/ip address
add address=192.168.1.1/24 interface=vlan110 network=192.168.1.0
add address=172.168.1.1/24 interface=vlan220 network=172.168.1.0

R2:

  • Add VirtualAP under wlan1 interface. (Also create wireless security-profiles for wlan1 and wlan2)
[admin@R2] >
/interface wireless
set [ find default-name=wlan1 ] disabled=no mode=ap-bridge security-profile=vlan110 ssid=vlan110
add disabled=no master-interface=wlan1 name=wlan2 security-profile=vlan220 ssid=vlan220
  • Add necessary VLAN interfaces on ethernet interface to make it as a VLAN trunk port.
  • Add bridges for each VLAN.
  • Add VLAN interfaces to their corresponding bridges and wireless interfaces to each bridge.
[admin@R2] >
/interface vlan
add interface=ether1 name=vlan110-ether1 vlan-id=110
add interface=ether1 name=vlan220-ether1 vlan-id=220

/interface bridge
add name=bridge-vlan110
add name=vlan220-bridge

/interface bridge port
add bridge=bridge-vlan110 interface=vlan110-ether1
add bridge=bridge-vlan110 interface=wlan1
add bridge=vlan220-bridge interface=vlan220-ether1
add bridge=vlan220-bridge interface=wlan2

R3:

  • Add ip address on wlan1 interface.
  • Create wireless security-profile compatible with R2 wlan1.
[admin@R3] >
/ip address
add address=192.168.1.3/24 interface=wlan1 network=192.168.1.0

/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan110

R4:

  • Add ip address on wlan1 interface.
  • Create wireless security-profile compatible with R2 wlan2.
[admin@R4] >
/ip address
add address=172.168.1.4/24 interface=wlan1 network=172.168.1.0

/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan220


Example 2

R1:

  • Add necessary VLAN interfaces on ethernet interface to make it as a VLAN trunk port. Add ip addresses on VLAN interfaces.
[admin@R1] >
/interface vlan
add interface=ether1 name=vlan110 vlan-id=110
add interface=ether1 name=vlan220 vlan-id=220

/ip address
add address=192.168.1.1/24 interface=vlan110 network=192.168.1.0
add address=172.168.1.1/24 interface=vlan220 network=172.168.1.0

R2:

  • Add VirtualAP under wlan1 interface. (Also create wireless security-profiles for wlan1 and wlan2)
[admin@R2] >
/interface wireless
set [ find default-name=wlan1 ] disabled=no mode=ap-bridge security-profile=vlan110 ssid=vlan110 vlan-id=110 vlan-mode=use-tag
add disabled=no master-interface=wlan1 name=wlan2 security-profile=vlan220 ssid=vlan220 vlan-id=220 vlan-mode=use-tag
Icon-note.png

Note: It is important to set wlan1,wlan2 vlan-mode to "use-tag".


  • Add necessary VLAN interfaces on ethernet,wlan1,wlan2 interfaces.
  • Add bridge for VLAN interfaces.
  • Add all VLAN interfaces to bridge1.
[admin@R2] >
/interface vlan
add interface=ether1 name=vlan110-ether1 vlan-id=110
add interface=ether1 name=vlan220-ether1 vlan-id=220

/interface bridge
add name=bridge1

/interface bridge port
add bridge=bridge1 interface=vlan110-wlan1
add bridge=bridge1 interface=vlan220-wlan2
add bridge=bridge1 interface=vlan110-ether1
add bridge=bridge1 interface=vlan220-ether1

R3:

  • Add ip address on wlan1 interface.
  • Create wireless security-profile compatible with R2 wlan1.
[admin@R3] >
/ip address
add address=192.168.1.3/24 interface=wlan1 network=192.168.1.0

/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan110

R4:

  • Add ip address on wlan1 interface.
  • Create wireless security-profile compatible with R2 wlan2.
[admin@R4] >
/ip address
add address=172.168.1.4/24 interface=wlan1 network=172.168.1.0

/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan220