Hi! Thank you a ton for DietPi. It’s a wonderful piece of software! I’m having some troubles configuring it though.
I’m trying to use NanoPi R5S as a smart network switch using its 3 Ethernet ports. I was able to successfully do that on the previous OS installed on it – an OpenWRT derivative. The relevant part of /etc/config/network file looked like this:
config interface 'lan'
option ipv6 'off'
option device 'switch0'
option proto 'dhcp'
option type 'bridge'
option name 'switch0'
list ports 'eth0'
list ports 'eth1'
list ports 'eth2'
option ipv6 '0'
option mtu '1500'
option macaddr '86:5E:CE:F4:81:18'
So I want to link eth0, eth1 and eth2 all into a single bridge. I tried replicating this on DietPi:
This partially works. I’m able to make connections to and from the DietPi host, but the traffic switching part doesn’t seem to be working: From a laptop connected over a wire to the NanoPi, I’m able to ssh into DietPi, but I’m not able to reach either my network router, nor the public internet. Everything works if I bypass the wired connection by using WiFi of course.
My network topology looks like this: OpenWRT router <=Ethernet-cable=> NanoPi <=Ethernet-cable=> laptop
And in the screenshot, it shows .100 as gateway/router.
You are telling your laptop, that the gateway/ route to internet is your DietPi device, which is not the case, it’s just another client in the LAN, which is acting like a router.
I think you would need to set gateway/router also to .1 on the laptop. (Or let DHCP all handle this)
(You could establish another subnet via DHCP on your NanoPi, then it would be the gateway of the connected clients. But then you need routing rules to you other subnet, so why fiddle with all that? Let the existing DHCP server handle all that.)
No, the NanoPi is already a part of your existing LAN an also the connected devices will become part of it.
I tried that and generally had problems with picking right IP addresses for the ethX interfaces: I needed to specify either a static one or a DHCP and neither of those makes sense or is necessary for bridging AFAIU (the bridge interface it’s the only one that should have an IP address). The current configuration that I have looks right: the bridge interface is up, it’s the only one that has an IP address, all the ethX interfaces are also up yet they don’t have IP addresses. That’s how it should all looks, so I’m a bit reluctant to touch it
Good point! I changed it and a ping 192.168.1.1 from the laptop still doesn’t reach the router though, indicating that packet switching on the DietPi still isn’t functional.
Thank you, that’s good to hear because it makes the entire setup simpler!
This is expected since nothing is connected to them. It’s like a router, the router itself (bridge) has an IP. The ports do not have an IP, only the devices you connect to this ports.
If you want them as interfaces, you can’t use the bridge mode.
iface eth0 inet manual # Set to "manual" to prevent automatic configuration
iface eth1 inet manual # Set to "manual" to prevent automatic configuration
iface eth2 inet manual # Set to "manual" to prevent automatic configuration
And you can also try to use DHCP on the laptop and check on the router if it assigned an IP to it.