I have a Rpi 2b ( no wifi) with openwrt installed ( intended use connect some iot devices / separate from my main router)
with a display & keyboard connected i can enter commands.
Following steps need to be performed:
step 1) I would like to connect this using eth0 to my main router lan to set it up using luci
step 2) Connect to current lan and add drivers for my wifi/usb module.
step 3) Setup with eth0 (wan side) and wifi module ( wlan )
Can anyone help me with step 1 to edit the /etc/config/ files to have it connect as a station to my main router lan (dhcp)?
When remembering correctly:
- On devices with 1 NIC, the 1 NIC will be assigned to the LAN interface.
- On a device with 2 or more NICs, the 2nd one will be WAN, the others by default are initially disabled.
You could download the required packages from internet via PC and upload them via LuCi, but that is boring and time consuming work.
If Wifi would already work, you could use WiFi as WAN. Since Wifi drivers are not yet installed, 2 options remain:
add a 2nd NIC by buying a USB-LAN Adapter
connect a PC to the 1 NIC of Pi and then reconfigure OpenWRT on Pi, to make Pi a network client (basically the same LAN config as for a „dumb access point“):
- on the LAN interface disable DHCP
- assign a non used static IP address to the LAN interface, the unused address must be from the subnet range of your home LAN (e.g. if your router is 192.168.2.1, you could use 192.168.2.2 for your Pi).
- Then connect the 1 Pi NIC port to the LAN side of your home router.
- Then call https://192.168.2.2 from a PC which is also connected to your home router (if everything works, this is the new IP address of the Pi)
- then start installing packages on your Pi, as it now has Internet access and can though load packages.
- then reconfigure Pi network parameters again, as needed in your target scenario
I tried with a usb/lan adapter and it got recognized as a new usb device. (AX88772A)
using cat /sys/kernel/debug/usb/devices it shows Driver=(none) for this device
so i guess this doesnt work without internet.
you can add the driver kmod package to a custom image, using the online image builder,
but a usb ethernet adapter will have many additional package dependencies.
or edit the
/etc/config/network file and change the interface lan section to
config interface 'lan'
option device 'br-lan'
option proto 'dhcp'
/etc/init.d/network restart afterwards.
you RPi should then get an IP from the main router.
That worked thx , i have internet using eth0