Difference between revisions of "Manual:VLANs on Wireless"

From MikroTik Wiki
Jump to: navigation, search
(created VLANs on Wireless article)
 
(Example 1)
Line 8: Line 8:
 
===Example 1===
 
===Example 1===
  
* abc
+
* R1
  
 
<pre>
 
<pre>
/interface ethernet
+
/interface vlan
set ether3 master-port=ether2
+
add interface=ether1 name=vlan110 vlan-id=110
set ether4 master-port=ether2
+
add interface=ether1 name=vlan220 vlan-id=220
set ether5 master-port=ether2
 
  
 
/ip address
 
/ip address
add address=192.168.88.1/24 interface=ether2 network=192.168.88.0
+
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>
 
</pre>
  
* abc
+
* R2
  
 
<pre>
 
<pre>
 
/interface vlan
 
/interface vlan
add name=vlan99 vlan-id=99 interface=ether2
+
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
 +
 
 +
/interface wireless security-profiles
 +
set [ find default=yes ] supplicant-identity=MikroTik
 +
add authentication-types=wpa2-psk eap-methods="" management-protection=allowed mode=dynamic-keys name=vlan110 supplicant-identity="" wpa2-pre-shared-key=passwordvlan110
 +
add authentication-types=wpa2-psk eap-methods="" management-protection=allowed mode=dynamic-keys name=vlan220 supplicant-identity="" wpa2-pre-shared-key=passwordvlan220
 +
 
 +
interface wireless
 +
set [ find default-name=wlan1 ] disabled=no mode=ap-bridge security-profile=vlan110 ssid=vlan110 vlan-id=110 wireless-protocol=802.11
 +
add disabled=no keepalive-frames=disabled mac-address=4E:5E:0C:78:CC:37 master-interface=wlan1 multicast-buffering=disabled name=wlan2 security-profile=vlan220 ssid=vlan220 vlan-id=220 wds-cost-range=0 wds-default-cost=0
  
/ip address
 
add address=192.168.88.1/24 interface=vlan99 network=192.168.88.0
 
 
</pre>
 
</pre>
 +
 +
* R3
  
 
<pre>
 
<pre>
/interface ethernet switch egress-vlan-tag
+
/interface wireless security-profiles
add tagged-ports=ether2,ether3,ether4,ether5,switch1-cpu vlan-id=99
+
set [ find default=yes ] supplicant-identity=MikroTik
 
+
add authentication-types=wpa2-psk eap-methods="" management-protection=allowed mode=dynamic-keys name=vlan110 supplicant-identity="" wpa2-pre-shared-key=passwordvlan110
/interface ethernet switch vlan
+
/interface wireless
add ports=ether2,ether3,ether4,ether5,switch1-cpu vlan-id=99 learn=yes
+
set [ find default-name=wlan1 ] disabled=no security-profile=vlan110 wireless-protocol=802.11
 +
/ip dhcp-client
 +
add default-route-distance=0 dhcp-options=hostname,clientid disabled=no interface=wlan1
 
</pre>
 
</pre>
  
* abc
+
* R4
  
 
<pre>
 
<pre>
/interface ethernet switch
+
/interface wireless security-profiles
set drop-if-invalid-or-src-port-not-member-of-vlan-on-ports=ether2,ether3,ether4,ether5
+
set [ find default=yes ] supplicant-identity=MikroTik
 +
add authentication-types=wpa2-psk eap-methods="" management-protection=allowed mode=dynamic-keys name=vlan220 supplicant-identity="" wpa2-pre-shared-key=passwordvlan220
 +
/interface wireless
 +
set [ find default-name=wlan1 ] disabled=no security-profile=vlan220 wireless-protocol=802.11
 +
/ip dhcp-client
 +
add default-route-distance=0 dhcp-options=hostname,clientid disabled=no interface=wlan1
 
</pre>
 
</pre>
 
  
 
===Example 2===
 
===Example 2===

Revision as of 17:33, 9 January 2017


Summary

abc.

Example 1

  • 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
/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

/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa2-psk eap-methods="" management-protection=allowed mode=dynamic-keys name=vlan110 supplicant-identity="" wpa2-pre-shared-key=passwordvlan110
add authentication-types=wpa2-psk eap-methods="" management-protection=allowed mode=dynamic-keys name=vlan220 supplicant-identity="" wpa2-pre-shared-key=passwordvlan220

interface wireless
set [ find default-name=wlan1 ] disabled=no mode=ap-bridge security-profile=vlan110 ssid=vlan110 vlan-id=110 wireless-protocol=802.11
add disabled=no keepalive-frames=disabled mac-address=4E:5E:0C:78:CC:37 master-interface=wlan1 multicast-buffering=disabled name=wlan2 security-profile=vlan220 ssid=vlan220 vlan-id=220 wds-cost-range=0 wds-default-cost=0

  • R3
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa2-psk eap-methods="" management-protection=allowed mode=dynamic-keys name=vlan110 supplicant-identity="" wpa2-pre-shared-key=passwordvlan110
/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan110 wireless-protocol=802.11
/ip dhcp-client
add default-route-distance=0 dhcp-options=hostname,clientid disabled=no interface=wlan1
  • R4
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa2-psk eap-methods="" management-protection=allowed mode=dynamic-keys name=vlan220 supplicant-identity="" wpa2-pre-shared-key=passwordvlan220
/interface wireless
set [ find default-name=wlan1 ] disabled=no security-profile=vlan220 wireless-protocol=802.11
/ip dhcp-client
add default-route-distance=0 dhcp-options=hostname,clientid disabled=no interface=wlan1

Example 2

[ Top | Back to Content ]