2

I've already set up my RPi 4 as a hotspot using dnsmasq and hostapd, using a USB 4G modem to connect to the internet. This is working as expected, I'm able to connect other devices to it and get network and internet access.

What I am trying to do is also share the USB internet through the ethernet port, so that I can hook up a RPi 3+ that way (WiFi on this board doesn't appear to work), both while being on the same network, ideally.

Is this possible?

  • Tell us how you configure a hotspot using dnsmasq and hostapd. || Has the connected 4G USB device made a new interface on ifconfig? – M. Rostami Jan 21 at 1:21
1

It is possible to forward traffic from the wired interface (eth0?) to the usb0 interface. Because you do not have provided any details about your network configuration I can only guess. You have to enable ip forwarding. There are several ways to do it: within /etc/sysctl.conf or by systemd-networkd or with /proc/sys/net/ipv4/ip_forward. Because you have already a working access point with uplink to your 4G modem, ip forwarding should already be enabled. Check if cat /proc/sys/net/ipv4/ip_forward returns 1. If so the wired connection could already work. Just try it.

If you are using a bridge instead of routing with enabled ip forwarding then you have to add the wired interface as additional slave to the bridge.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.