This video tutorial demonstrates how to configure a "router on a stick" using a Raspberry Pi 5 running OpenWRT and a Layer 3 capable network switch. The concept involves leveraging VLANs to enable a single physical Ethernet port on the Raspberry Pi to function as multiple logical interfaces (e.g., WAN and LAN). The presenter provides a step-by-step guide on setting up VLAN filtering and bridge devices within OpenWRT's LuCI interface, followed by the corresponding configuration of tagged and untagged ports on an Aruba 1930 Layer 3 switch. The video concludes with a successful demonstration of network connectivity and a discussion of the performance implications, noting that while cost-effective for manufacturers, this architecture shares bandwidth across all network traffic through the single port, potentially limiting overall throughput compared to routers with dedicated network interfaces.
Exploring the "Router on a Stick" with Raspberry Pi 5 and OpenWRT
0:00 Introduction to "Router on a Stick": The video introduces the concept of a "router on a stick," or one-arm router, which operates with only a single Ethernet port, exemplified by a Raspberry Pi 5 running OpenWRT.
1:16 VLANs for Virtual Ports: The core idea is to use VLANs to transform one physical Ethernet port into multiple logical (virtual) Ethernet ports, enabling the single port to handle both WAN and LAN traffic. The "stick" refers to the single Ethernet cable carrying all these networks.
2:20 Layer 3 Switch Requirement: Implementing a "router on a stick" necessitates a Layer 3 switch to manage inter-VLAN routing and direct traffic between different physical ports.
2:54 Common Industry Practice: The presenter highlights that many commercial routers, such as the Netgear R6800, employ a similar "router on a stick" architecture internally by using a single Ethernet controller and creating VLANs for their LAN and WAN interfaces to reduce manufacturing costs.
7:05 OpenWRT Configuration - VLANs: The tutorial begins with configuring OpenWRT via its LuCI web interface. A new bridge device (br1) is created, and VLAN filtering is enabled. VLAN ID 1 is set as untagged on eth0 (for initial LAN access to the router), while VLAN ID 2 is set as tagged on eth0 (for the WAN connection).
10:22 OpenWRT Configuration - WAN Interface: A new wan interface is created, linked to the br1.2 VLAN device, and assigned to the WAN firewall zone.
11:31 Layer 3 Switch Configuration: The video then demonstrates configuring VLANs (VLAN 1 and VLAN 2) on an Aruba 1930 Layer 3 switch.
Interface 1 (WAN Port): Configured with VLAN 2 untagged, connecting to the upstream modem/internet.
Interface 2 (Raspberry Pi Port/Trunk): Configured with VLAN 2 tagged and VLAN 1 untagged. This is the crucial single connection to the Raspberry Pi.
Interface 3 (LAN Port): Configured with VLAN 1 untagged, connecting to a local computer.
16:03 Connectivity Verification: After configuration, the setup is successfully tested, confirming both local LAN connectivity (via client IP address) and internet access (via WAN IP and ping).
17:44 Performance Considerations: A key takeaway is that while "router on a stick" saves hardware costs, it inherently shares the bandwidth of the single Ethernet controller for all network traffic (both WAN and LAN). This can lead to performance bottlenecks compared to routers that feature dedicated Ethernet controllers for separate network segments.