Vlans

The following scenarios show how to configure WLAN capable devices to use VLANs in order to tag the packets that are sent through the Ethernet port depending on the input network.

../../../_images/wlanvlans.svg

VLANs

Description

In this example, two wlan interfaces will be created on the DUT0: wlan4 on top of the 2.4GHz radio and wlan1 on top of the 5GHz radio. Each one will have a different VLAN to show how to separate the traffic in the local LAN. Then, a WLAN client will connect first to network_2.4GHz to do some ping requests (step 1) and then to network_5GHz to do the same (step 2).

Scenario

Step 1: Set the following configuration in DUT0:

set controllers wlan installation indoor
set interfaces ethernet eth2 bridge-group bridge br0
set interfaces ethernet eth2 bridge-group vlan 10
set interfaces ethernet eth2 bridge-group vlan 20
set controllers wlan radios wifi1 band 2.4GHz
set controllers wlan radios wifi1 channel 1
set interfaces bridge br0
set interfaces wlan wlan4 bridge-group bridge br0
set interfaces wlan wlan4 bridge-group vlan 10 pvid
set interfaces wlan wlan4 bridge-group vlan 10 untagged
set interfaces wlan wlan4 phy wifi1
set interfaces wlan wlan4 type access-point security akm none
set interfaces wlan wlan4 type access-point ssid network_2.4GHz
set controllers wlan radios wifi0 band 5GHz
set controllers wlan radios wifi0 channel 36
set controllers wlan radios wifi0 bandwidth 80MHz
set controllers wlan radios wifi0 mode 802.11n
set controllers wlan radios wifi0 mode 802.11ac
set controllers wlan radios wifi0 mode 802.11ax
set interfaces bridge br0
set interfaces wlan wlan1 bridge-group bridge br0
set interfaces wlan wlan1 bridge-group vlan 20 pvid
set interfaces wlan wlan1 bridge-group vlan 20 untagged
set interfaces wlan wlan1 phy wifi0
set interfaces wlan wlan1 type access-point security akm none
set interfaces wlan wlan1 type access-point ssid network_5GHz

Note

Note that in the previous configuration, all traffic originated on the wlan4 will be tagged with the VLAN ID 10 when leaving through the Ethernet interface. Traffic originated on the wlan1 will be tagged with the VLAN ID 20.

Step 2: Set the following configuration in DUT1:

set interfaces ethernet eth0 vif 10 address 192.168.10.1/24
set interfaces ethernet eth0 vif 20 address 192.168.20.1/24

Note

The DUT1 only has one IP address in each VLAN to respond ping requests when neccesary.

Step 3: Configure the MON device to connect to network_2.4GHz using the following configuration:

set controllers wlan installation indoor
set controllers wlan radios wifi0 bandwidth 20MHz
set interfaces wlan wlan0 phy wifi0
set interfaces wlan wlan0 type station network 1 bssid 52:5a:65:42:f9:89
set interfaces wlan wlan0 type station network 1 ssid network_2.4GHz
set system wlan log-level configuration debug
set interfaces wlan wlan0 address 192.168.10.10/24
set interfaces wlan wlan0 type station network 1 security akm none

Step 4: Ping IP address 192.168.10.1 from MON:

admin@MON$ ping 192.168.10.1 count 2 size 56 timeout 1
Show output
PING 192.168.10.1 (192.168.10.1) 56(84) bytes of data.
64 bytes from 192.168.10.1: icmp_seq=1 ttl=64 time=7.82 ms
64 bytes from 192.168.10.1: icmp_seq=2 ttl=64 time=23.3 ms

--- 192.168.10.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 7.824/15.581/23.339/7.758 ms

Step 5: Configure the MON device to connect to network_5GHz using the following configuration:

set controllers wlan installation indoor
set controllers wlan radios wifi1 bandwidth 20MHz
set interfaces wlan wlan0 phy wifi1
set interfaces wlan wlan0 type station network 1 bssid 52:5a:65:42:f9:88
set interfaces wlan wlan0 type station network 1 ssid network_5GHz
set system wlan log-level configuration debug
set interfaces wlan wlan0 address 192.168.20.10/24
set interfaces wlan wlan0 type station network 1 security akm none

Step 6: Ping IP address 192.168.20.1 from MON:

admin@MON$ ping 192.168.20.1 count 2 size 56 timeout 1
Show output
PING 192.168.20.1 (192.168.20.1) 56(84) bytes of data.
64 bytes from 192.168.20.1: icmp_seq=1 ttl=64 time=6.67 ms
64 bytes from 192.168.20.1: icmp_seq=2 ttl=64 time=2.79 ms

--- 192.168.20.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 2.785/4.728/6.672/1.944 ms