Configuring VLAN

This chapter describes how to configure VLAN on the Cisco LoRaWAN Gateway. The LoRaWAN Gateway supports IEEE 802.1Q encapsulation. You can configure the fastethernet port as a trunk port that enables tagging of outgoing traffic from the Cisco LoRaWAN Gateway.

Configuring IP Address for VLAN

Beginning in privileged EXEC mode, follow these steps to configure IP address for the VLAN:

Procedure

  Command or Action Purpose

Step 1

configure terminal

Enter global configuration mode.

Step 2

interface vlan vlan-id

Enter interface configuration mode, and enter the VLAN to which the IP information is assigned. The VLAN range is 1 to 4094.

Step 3

ip address {ip-address subnet-mask | dhcp }

Configure the IP address.

Step 4

exit

Return to global configuration mode.

Step 5

show interfaces vlan vlan-id

Verify the configured IP address.

Step 6

copy running-config startup-config

(Optional) Save your entries in the configuration file.

Configuring VLAN Trunks

A trunk is a point-to-point link between one or more Ethernet interfaces and another networking device such as a router or a switch. Ethernet trunks carry the traffic of multiple VLANs over a single link, and you can extend the VLANs across an entire network.

You can configure the FastEthernet port as a trunk port that enables tagging of outgoing traffic from the Cisco LoRaWAN Gateway.

Configuring a Trunk Port

Beginning in privileged EXEC mode, follow these steps to configure a trunk port:

Procedure

  Command or Action Purpose

Step 1

configure terminal

Enter global configuration mode.

Step 2

interface interface-id

Specify the port to be configured for trunking, and enter interface configuration mode.

Step 3

switchport mode trunk

Set the interface in permanent trunking mode and negotiate to convert the link to a trunk link even if the neighboring interface is not a trunk interface.

Step 4

exit

Return to privileged EXEC mode.

Step 5

copy running-config startup-config

(Optional) Save your entries in the configuration file.

What to do next

To reset all trunking characteristics of a trunking interface to the defaults, use the no switchport trunk interface configuration command.

Defining the Allowed VLANs on a Trunk

By default, a trunk port sends traffic to and receives traffic from all VLANs. All VLAN IDs, 1 to 4094, are allowed on each trunk. However, you can remove VLANs from the allowed list, preventing traffic from those VLANs from passing over the trunk.

Beginning in privileged EXEC mode, follow these steps to modify the allowed list of a trunk:

Procedure
  Command or Action Purpose

Step 1

configure terminal

Enter global configuration mode.

Step 2

interface interface-id

Specify the port to be configured, and enter interface configuration mode.

Step 3

switchport mode trunk

Configure the interface as a VLAN trunk port.

Step 4

switchport trunk allowed vlan vlan-id

(Optional) Configure the VLAN allowed on the trunk.

Step 5

exit

Return to privileged EXEC mode.

Step 6

copy running-config startup-config

(Optional) Save your entries in the configuration file.

What to do next

To return to the default allowed VLAN list of all VLANs, use the no switchport trunk allowed vlan interface configuration command.

Enabling Sending and Receiving Tagged Packet on Ethernet Port

To enable sending and receiving of tagged packets on the Ethernet port, the following needs to be configured on the Cisco LoRaWAN Gateway:


interface FastEthernet 0/1
switchport mode trunk
switchport trunk allowed vlan <vlan id 1-4094>
exit
!
interface Vlan <vlan-id>
ip address <dhcp | ip mask>
 

Note


Only a single vlan tag is allowed on the trunk port. All traffic destined for network specified by interface vlan IP address will go out of the Ethernet port with that vlan tag.

The port will also expect incoming packets (with its own ip address or broadcast address) to be tagged with the same vlan tag. In order for the peer switch or router to send tagged packets to the Cisco LoRaWAN Gateway, they need to be configured as trunk ports as well.

Here is a configuration example on a Cisco ME3400 switch:


interface FastEthernet0/23
switchport trunk allowed vlan 220
switchport mode trunk
 

Note


The uplink to the rest of the network from this switch also needs to include this vlan.

On a Catalyst 3750 it would be:


interface GigabitEthernet 1/0/1
  switchport trunk encapsulation dot1q
  switchport trunk allowed vlan <vlan_id>
  switchport mode trunk
 

If you need to use Vlan 1, remember that Cisco switches treat Vlan 1 as the native vlan on trunk ports by default. That is, incoming “untagged” packets will be treated as they belong to Vlan 1. And similarly when Vlan 1 packets untagged are sent. These packets will not be picked up on the Cisco LoRaWAN Gateway Vlan interface. To avoid this, a different native vlan must be chosen on the peer switch. See the following example:


interface GigabitEthernet 1/0/1
  switchport trunk encapsulation dot1q
  switchport trunk native vlan <vlan id other than 1>
  switchport trunk allowed vlan 1
  switchport mode trunk

Examples of Show Commands


Router# show vlan
 VLAN Name                             Status    Ports 
 ---- -------------------------------- --------- --------------------------------
  220 VLAN0220                         Active     Fa0/1

Router# show interfaces
Vlan220 is up
        address is 00:50:43:24:1F:4A
        MTU is 1500 bytes
FastEthernet0/1 is up
        Hardware is Fast Ethernet, address is 00:5F:86:5C:27:78
        MTU is 1500 bytes

Router# show interfaces Vlan 220
Vlan220 is up
        address is 00:50:43:24:1F:4A
        MTU is 1500 bytes

Router# show ip interface
  FastEthernet  FastEthernet IEEE 802.3
  Vlan          Vlan IEEE 802.1q

Router# show ip interface Vlan 220
Vlan220  is up
  Internet address is 172.27.165.208
  Netmask is 255.255.255.128
  Broadcast address is 172.27.165.255
  MTU is 1500 bytes