I've configured a Pi 3B+ to act as a WiFi access point using the excellent instructions here. When the Pi's ethernet is connected it gives WiFi clients access to the internet, and when the ethernet cable is unplugged WiFi clients access the local network only.

Everything works great until I enable Overlay Filesystem via raspi-config. The Pi itself still has access to the internet, which I can verify with ping www.google.com, but routed internet access no longer works for WiFi clients. I believe the problem is related to a changed network interface name.

When Overlay Filesystem is disabled the ethernet interface is called eth0 in the output from ifconfig. The access point documentation expects eth0 in the command sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE.

However, when Overlay Filesystem is enabled the network interface is called enxb827eb064f2f. If I execute sudo iptables -t nat -A POSTROUTING -o enxb827eb064f2f -j MASQUERADE while in Overlay Filesystem the internet is correctly routed to WiFi clients, but that change is obviously lost on reboot. I tried executing this command with Overlay Filesystem disabled, and then re-enabled Overlay, but it did not work - presumably because the network interface enxb827eb064f2f was not known at the time the command was executed. The name enxb827eb064f2f appears stable across reboots in Overlay Filesystem, so the problem was not that the interface name changed. If I disable Overlay Filesystem again the internet name returns to eth0 and routing works as expected.

Is there any way I can ensure the ethernet interface retains the name eth0 in Overlay Filesystem, or some other way I can pre-emptively configure routing via the alternate interface name?


How to set up networking/WiFi explains Predictable Network Interface Names which are usable as an interface specifier in any context; indeed most 'NIX systems use these and they can be enabled in raspi-config (it may be more accurate to say that this removes the code that disables Predictable Network Interface Names).

Whatever you did presumably broke the Raspberry Pi OS code which maps the interface to eth0, but without knowing what you have actually done or indeed what you are attempting to achieve no one can tell you how to change it, particularly as you have provided no details or diagnostics.

Incidentally the tutorial you linked is adequate but hardly the best - systemd-networkd is the current "best practice" (although more complex to setup) and includes all the network functionality to implement an access point without additional packages.

  • Thanks for your input, I will see if there's anything I can do around predictable naming. re: "Whatever you did" - it was literally just raspi-config -> Performance Options -> Overlay Filesystem -> Enabled -> reboot. If I follow the reverse steps to disable Overlay Filesystem via raspi-config the problem goes away. This problem entirely revolves around enabling a feature via raspi-config
    – tomfumb
    Mar 4 at 17:23

There is undoubtedly a better solution out there but, for the sake of moving forwards, I chose to add iptables -t nat -A POSTROUTING -o enxb827eb064f2f -j MASQUERADE into /etc/rc.local so that routing is re-established each time the Pi boots with Overlay Filesystem enabled.

It's not pretty but it works.

  • 1
    I ran into the same problem when turning on the overlay filesystem. I turned on p Predictable Network Interface Names. This way the name for eth0 (your enxb8...) stays the same when the overlay filesystem is enabled and when it is disabled. I then used that name in my iptables rules instead of eth0.
    – fnurl
    Jun 20 at 14:00

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.