rspitzde
Posts: 2
Joined: Sun Feb 11, 2024 4:37 pm

Pi4 as WiFi AP, sharing Ethernet connection in parallel

Sun Feb 11, 2024 5:24 pm

Hello,

I have the following setup:
- Pi4 running Bullseye, headless, powered by PoE HAT
- Configured as WiFi AP using the excellent tutorial https://www.raspberryconnect.com/projec ... pcd-method. Basically, this uses hostapd, dnsmasq, dhcpcd and NFtables.
- 2 sensors attached via USB

I now need to connect another device via ethernet, so my plan is to use an USB-to-Ethernet-Adapter and configure some kind of "pass through" of the two ethernet ports. I understand that normally this would be done by configuring a bridge, but after some reading on this subject, I'm afraid that this would make me lose the WiFi AP functionality and also make the Pi inaccessible via SSH. This must be avoided, since the Pi is located in a locked room and I need to make an appointment with facility management every time I want to get in there. There is also no power outlet available in that room, so I cannot simply install a network switch and need to use PoE to power the Pi.

I can only use SSH to log into the Pi, no VNC or other graphical desktop, terminal only.

The device to be connected doesn't necessarily have to be in the same subnet as the Pi, only the internet connection has to be passed through.

I hope my description of my requirement is understandable, English is not my native language. So how can I achieve what I want?

rspitzde
Posts: 2
Joined: Sun Feb 11, 2024 4:37 pm

Re: Pi4 as WiFi AP, sharing Ethernet connection in parallel

Mon Feb 12, 2024 2:34 pm

Turned out to be easier than I had thought:

- Plug in USB3-to-Ethernet-Adapter (Amazon Basics), detected automatically and assignet interface name "eth1"
- Add config in /etc/dhcpcd.conf for "eth1", just like for "wlan0" in the linked AP configuration instructions, only different subnet
- Add config in /etc/dnsmasq.conf for "eth1", just like for "wlan0" in the linked AP configuration instructions, only different subnet
- Reboot
- Enjoy :D

I had also added config for NFtables, but forgot to include that in /etc/nftables.conf and it works anyway. What problems could be caused by not having an NFtables ruleset for routing eth1 through eth0?

Return to “Networking and servers”