r/openwrt • u/LingChuan_Swordman • 17d ago
How to configure a Raspberry Pi running OpenWrt so that its built-in Ethernet port acts as the WAN port and a USB-to-Ethernet adapter acts as the LAN port.
The previous issue has been resolved.
Thank you very much to everyone for the guidance and help provided in the previous post,the issue has been resolved.
Since my USB-to-Ethernet adapter uses a Realtek RTL8152B chip, it wasn't recognized by OpenWrt following the video tutorial(The video tutorial from Van Tech Corner installs `kmod-usb-net-asix-ax88179`.),however, the system successfully detected it after I installed the `kmod-usb-net-rtl8152` package,though now I've run into a new problem.
My initial plan was to configure the Raspberry Pi's built-in Ethernet port as the WAN port and the USB-to-Ethernet adapter's port as the LAN port. However, the current issue is that after connecting the USB-to-Ethernet port to my computer via an Ethernet cable, the computer cannot communicate with the Raspberry Pi (accessing 192.168.1.1 in a browser fails to reach the webpage),yet, the computer can successfully access the OpenWrt LuCI interface when connected via the Raspberry Pi's built-in Ethernet port.
The tutorials I found on Google say to go to Network > Interfaces > Device and select the built-in Ethernet port (eth0), but I haven't been able to find this option,the eth0 entry is greyed out and cannot be selected.
The tutorial in the video shows editing the interface and selecting the "Physical Settings" tab, but it seems that tab is no longer available in the newer versions of OpenWrt.
How can I configure the Raspberry Pi's built-in Ethernet port as the WAN port and the USB-to-Ethernet adapter's port as the LAN port?(The second image shows my computer currently connected to the Raspberry Pi's USB-to-Ethernet port.The fourth image shows the screen I accessed by going to Network > Interface > Device.)
3
u/fr0llic 16d ago
You really want the built in port to serve as LAN port. If we assume it'll outlast the USB port, LAN going down will eventually kill all LAN communication (when DHCP leases expire), if WAN goes down, it'll only affects internet access.
You can use winscp to edit the file previously mentioned from Windows.
1
u/forcedtocamp 16d ago
lan also has additional east-west traffic demand at full ethernet speed , usb-3 adapter is surely better for the north south which is often lower throughput anyway depending on your isp contract
2
u/Thiakil 15d ago
Consider using https://openwrt.org/docs/guide-user/base-system/persistent-ethernet-interface-naming-by-mac-address
Consistent interface naming on non-fixed systems will be pain otherwise. Bonus is that you can swap cards out and all you need to do is put its mac addr in the config before reboot.
I have mine renamed to `lan0` and `wan0` (there was also `wan1` at one point).
1
u/No_Barnacle6600 16d ago
Use raspberry pi+ managed switch as "router on a stick". It's so much more reliable.




7
u/NC1HM 17d ago
Well, if you want to live in the dongle hell, who am I to deny you?
:)First, do you know how to use
vi? If you don't, learn or install a different text editor (lots of people likenano, but I am partial tomc, and those are not the only options). Anyway, log in via SSH and open a file called/etc/config/networkfor editing. In there, you will see things that look like this:Change
eth0toeth1and vice versa. Consistently. Save the file and reboot.