I've been on this for days. I looked this up everywhere I could, and I find pieces of answers, but not all seem to say the same thing, and I'm not sure all of them are relevant. (For example, do I need a VLAN?)
Here's the situation: I'm trying to turn a Raspberry Pi 4B into a router. I'll have the uplink on port eth1, which is a USB-to-Ethernet connector. Currently, it's my regular network on 192.168.1.0/24. I'm also connecting through Wi-Fi. Eventually, I'll have my old router in bridge mode connected to the Pi for the LAN. Currently, the LAN is on 192.168.2.0/24.
From the Pi, I can access my regular network. I can ping my other machines, 8.8.8.8, and other addresses. I can also access the LAN. I can ping my computer connected via Wi-Fi on 192.168.2.77 and the computer can access the Pi on 192.168.2.140. These are all static addresses. DHCP does not seem to work yet.
BUT, from my local computer, I cannot access anything beyond the 192.168.2.0/24 network. I cannot access 192.168.1.1 (the current router), or 8.8.8.8. Eth1 needs to work as an uplink.
Bridging eth0 and eth1 produced no effect I could notice. I read something about creating a VLAN, but that seems to be for routers that have several Ethernet ports.
Also (but less important currently):
- How should I make OpenWrt set the correct nameservers? Currently, it's always set to 127.0.0.1, until I change it in
/etc/resolv.conf
. The correct nameservers are set in the Interface device configuration, but OpenWrt seems to be ignore that. - How do I set up a DHCP server on eth0 (the LAN)? I set up the DHCP options in the Interface section, but it didn't produce any effect.
- How do I make eth1 (the future WAN) a DHCP client? When connected to the ISP, eth1 will have to work as a client, as the IP address is dynamic. It should already be possible since eth1 is connected to my existing network and the router already assigns the addresses via DHCP.
Am I missing some packages not installed by default? I had to install the driver for the USB-to-Ethernet module. I installed the kernel module for "bonding", but it doesn't look like I actually need it.
I can include the content of my /etc/config/network
if it's useful, but currently, I can only access the internet (like this website) or the OpenWrt server at a time, not both, so it would be a pain to get it right now, but I can add it as a follow-up later.
My router is a MR8300. I know I could flash it, but I'd rather start on a Pi. Also, the idea at some point will be to have the router run a domain name server, maybe Kerberos-based single-sign-on, and other central network functions. I don't think that the router will be able to run all that.
Even though it may not sound like it, I'm extremely impressed by OpenWrt. It's exactly what I had been seeking for this project. But now, I need to improve my understanding of how networks work.
Thanks!