EdgeRouter - Configure an EdgeRouter as a Layer 2 Switch


In this article the reader will learn the steps needed to configure an EdgeRouter X, X-SFP, or EdgePoint R6 as a Layer 2 switch with the option for the switch ports to be VLAN aware. 

Applicable to the latest EdgeOS firmware on the following EdgeRouter models:
  • EdgeRouter X
  • EdgeRouter X-SFP
  • EdgePoint R6

Table of Contents

  1. Switch Wizard Configuration (Recommended)
  2. Manual Configuration
  3. Related Articles

Switch Wizard Configuration (Recommended)

Back to Top

The latest EdgeOS firmware includes a built-in wizard to easily configure the EdgeRouter as a Layer 2 switch and includes a VLAN Aware option.

GUI: Access the Graphical User Interface (GUI).

1. Navigate to the Wizards tab and run the switch wizard.

Wizards > Switch

2. Define the management access settings. The available options are:

  • Management VLANOptionally set the VLAN ID which is used for the management traffic.
  • DHCPBy default the router will obtained an IP address using DHCP.
  • StaticConfigure this option if you want to set a static IP address.
  • UsernameSet to ubnt by default. We strongly recommend that you configure your own user account with a strong password.

3.  Configure the EdgeRouter as a VLAN Aware switch. The available options are:

  • pvidUntags a certain VLAN on a switch port. Supports only a single value per interface.
  • vidTags a VLAN or multiple VLANs on a switch port. Supports multiple values per interface.
NOTE: If you set the pvid value on a switch port that is also tagging other VLANs with vid, the VLAN set with pvid will become the native VLAN.  

4. Apply the changes and reboot the router when prompted.

The example below enables the VLAN Aware feature and defines the following VLAN switch port settings:

  • eth0Untagged VLAN10.
  • eth1Untagged VLAN20.
  • eth2Untagged VLAN30.
  • eth3Untagged VLAN40.
  • eth4Tagged VLAN20,30,40 with untagged (native) VLAN10.
  • eth5Tagged VLAN20,30,40 with untagged (native) VLAN10.


Manual Configuration

Back to Top

ATTENTION: It is recommended to use the wizard above instead of manually configuring the L2 switch functionality.

1. With the device in the factory default state, connect an Ethernet cable from a computer to the eth0 interface on the EdgeRouter. 

2. Configure a static IP address of your computer in the range.

3. Open a Web Browser and enter in the address bar.

4. Log into the router using the default credentials.

Username: ubnt
Password: ubnt

5. Configure the switch0 interface and provide it with an IP address.

Dashboard > switch0 > Actions > Config

Address: Manually define IP address

6. Associate the switch0 interface with the relevant switch ports, excluding the eth0 interface.

Dashboard > switch0 > Actions > VLAN

VLAN Aware: Unchecked
eth0: Unchecked
eth1: Checked
eth2: Checked
eth3: Checked
eth4: Checked
eth5: Checked

7. Replug the computer from the eth0 interface one of the other interfaces and change the static IP to an address in the range.

8. Open a Web Browser and enter in the address bar.

9. Remove the IP address from the eth0 interface.

Dashboard > eth0 > Actions > Config

Address: No address

10. Associate the switch0 interface with the eth0 interface. 

Dashboard > switch0 > Actions > VLAN

eth0: Checked

Related Articles

Back to Top

EdgeRouter - Beginners Guide to EdgeRouter

Intro to Networking - How to Establish a Connection Using SSH

We're sorry to hear that!