OpenWrt Router: A Comprehensive Guide
OpenWrt is an open-source router firmware that offers a wide range of features and flexibility. This article focuses on configuring an OpenWrt router with three interfaces: br-lan, eth1, and a third interface.
Understanding OpenWrt Interfaces
OpenWrt interfaces are virtual network devices that allow the router to connect to different networks. The three interfaces in this guide are:
br-lan: This is the LAN network interface with an IP address of 172.16.21.1 and a subnet mask of 255.255.255.0 (or 24-bit subnet mask).eth1: This is the WAN network interface with an IP address of 172.16.22.2 and a subnet mask of 255.255.255.252 (or 30-bit subnet mask). This interface is used for Internet access.
Configuring the LAN Interface (br-lan)
To configure the LAN interface, follow these steps:
- Log in to the OpenWrt web interface.
- Go to
Network > Interfaces. - Find the
br-laninterface and clickEdit. - In the
General Settingstab, make sure theProtocolis set toDHCP server. - In the
DHCP Servertab, set theStartandMax number of DHCP leasesaccording to your network requirements. - Click
Save & Applyto save the changes.
Configuring the WAN Interface (eth1)
To configure the WAN interface, follow these steps:
- Log in to the OpenWrt web interface.
- Go to
Network > Interfaces. - Find the
eth1interface and clickEdit. - In the
General Settingstab, set theProtocoltoDHCP clientorStatic address, depending on your Internet connection type. - If using
DHCP client, the interface will automatically obtain an IP address from the Internet service provider. If usingStatic address, enter the appropriate IP address, subnet mask, and gateway provided by your Internet service provider. - Click
Save & Applyto save the changes.
Configuring the Third Interface
To configure the third interface, follow these steps:
- Log in to the OpenWrt web interface.
- Go to
Network > Interfaces. - Click
Add new interface. - In the
General Settingstab, enter a name for the interface, set theProtocoltoNone, and choose the correctPhysical Settingsfor the interface. - In the
Firewalltab, set theForwardingtoLANandAllow incoming packetstoYes. - Click
Save & Applyto save the changes.
- OpenWrt interfaces allow the router to connect to different networks.
- The
br-laninterface is the LAN network interface with IP address 172.16.21.1 and subnet mask 255.255.255.0. - The
eth1interface is the WAN network interface with IP address 172.16.22.2 and subnet mask 255.255.255.252. - The third interface can be configured with a unique name, the
Noneprotocol, and LAN forwarding.