EdgeRouter - How to Configure an EdgeRouter as a Switch

Overview


The reader will learn the steps needed to configure an EdgeRouter X, X-SFP, or EdgePoint R6 as a switch. Note: this article only applies to these models: EdgeRouter X and X-SFP, EdgePoint R6. As of firmware version 1.8.5, VLAN untagging and tagging is supported.

Table of Contents


Step 1 - Connect to Device
Step 2 - Add Address and Ports to switch0
Step 3 - Connect to switch0
Step 4 - Remove Address from eth0
Step 5 - Add eth0 to switch0
Step 6 - Enable VLAN Functionality
CLI Commands to Configure EdgeRouter as a Switch
Related Articles


Step 1 - Connect to Device


Back to Top

1.1. With the device in factory default state, connect your computer to eth0. Make sure that your system has an IP in the 192.168.1.x subnet. (e.g. 192.168.1.11).

1.2. Enter https://192.168.1.1 in your web browser and log into the device using the default ubnt/ubnt username and password. (It is always good practice to change the default username and password to one of your choosing.)

Step 2 - Add Address and Ports to switch0


Back to Top

2.1. Click on Actions > Configure for the switch0 interface on the Dashboard of the device.

2.2. Change Address to Manually define IP address.

2.3. Enter 192.168.2.1/24 (or similar) in the address field and click Save.

2.4. Select the Vlan tab and check all of the ports you would like apart of the switch0 with the exception of eth0. Enabling the VLAN aware checkbox will be addressed in Step 6, so you may leave it unchecked to have Layer 2 switch functionality.

Note: finish the remaining steps to add eth0 to switch0.

Step 3 - Connect to switch0


Back to Top

3.1. Plug your computer into eth1 or any port which has been assigned to switch0 in Step 2.

3.2. Enter https://192.168.2.1 in your web browser and log into the device using your username and password.

Note: if you choose to assign switch0 a different address than the one used in this example, you would enter that address to access the device.

Step 4 - Remove Address from eth0


Back to Top

4.1. Click on Actions > Configure for eth0.

4.2. Change address to "No address"

4.3. Click Save

Step 5 - Add eth0 to switch0


Back to Top

5.1. Click Actions > Configure for switch0.

5.2. Check eth0 under Switch Ports.

5.3. Click Save.

This completes the steps to allow these devices to act as a layer 2 switch on all ports.

Step 6 - Enable VLAN Functionality


Back to Top

To enable VLAN tagging and untagging check the Enabled checkbox for the VLAN Aware item and assign PVID and VIDs as needed. In this example we will create eth0 as a trunk port passing the default VLAN 1 and VLANs 9-11. eth1 will untag VLAN 9; eth2 will untag VLAN 10, and eth3 will untag VLAN11. 

CLI Commands to Configure EdgeRouter as a Switch


Back to Top

1. Connect to the router CLI.

2. Configure switch0 and add ports.

configure
set interfaces switch switch0 switch-port interface eth1
set interfaces switch switch0 switch-port interface eth2
set interfaces switch switch0 switch-port interface eth3
set interfaces switch switch0 switch-port interface eth4
set interfaces switch switch0 switch-port interface eth5
Set interfaces switch switch0 address 192.168.2.1/24
commit 
save
exit

3. Plug your computer into eth1 or any port which has been assigned to switch0.

4. Reconnect to the CLI for the device at 192.168.2.1.

5. Remove address from eth0 and assign eth0 to switch0.

configure
delete interfaces ethernet eth0 address
commit
set interfaces switch switch0 switch-port interface eth0
commit
save
exit

6. Enable Layer 3 Functionality

As in the GUI example above, with these commands we will create eth0 as a trunk port passing the default VLAN 1 and VLANs 9-11. eth1 will untag VLAN 9; eth2 will untag VLAN 10, and eth3 will untag VLAN11.

configure
set interfaces switch switch0 switch-port vlan-aware enable
set interfaces switch switch0 switch-port interface eth0 vlan pvid 1
set interfaces switch switch0 switch-port interface eth0 vlan vid 9
set interfaces switch switch0 switch-port interface eth0 vlan vid 10
set interfaces switch switch0 switch-port interface eth0 vlan vid 11
set interfaces switch switch0 switch-port interface eth1 vlan pvid 9
set interfaces switch switch0 switch-port interface eth2 vlan pvid 10
set interfaces switch switch0 switch-port interface eth3 vlan pvid 11
commit
save
exit

Related Articles


Back to Top

Powered by Zendesk