Sharing Ethernet connection with Wifi and USB ethernet using systemd-networkd
0
votes
0
answers
610
views
I am running Raspbian 11 on a Raspberry Pi 4 and have connected a USB Ethernet NIC.
My goal is to allow clients to connect via Wi-Fi (wlan0) or the USB Ethernet adapter (eth1), then have the Raspberry Pi route all traffic through the primary Ethernet connection (eth0).
This setup must still function when eth0 is disconnected (though obviously without internet access).
**Problem**: I have configured all interfaces (wlan0, eth1, and eth0), but traffic from wlan0 and eth1 is not being routed through eth0 to the internet..
Here is how I have configured
systemd-networkd
:
/etc/systemd/network/09-default.network
:
[Match]
Name=eth0
[Link]
RequiredForOnline=no
[Network]
DHCP=ipv4
[Bridge]
Priority=0
[DHCPv4]
ClientIdentifier=mac
/etc/systemd/network/10-wlan0.network
:
[Match]
Name=wlan0
Type=wlan
[Network]
DHCP=no
Address=192.168.8.1/24
DHCPServer=yes
IPMasquerade=yes
[DHCPServer]
PoolOffset=10
PoolSize=100
/etc/systemd/network/11-eth1.network
:
[Match]
Name=eth1
[Network]
DHCP=no
Address=192.168.10.1/24
DHCPServer=yes
IPForward=yes
IPMasquerade=yes
[DHCPServer]
PoolOffset=10
PoolSize=100
Asked by Jim Cortez
(101 rep)
Jun 9, 2023, 11:14 PM
Last activity: Apr 3, 2025, 09:57 AM
Last activity: Apr 3, 2025, 09:57 AM