Pack3tL0ss / ConsolePi

Raspberry Pi Based Serial Console Server, with PushBullet Notification of IP changes, Automatic VPN termination, custom menu, Power Outlet Control, and a lot more
MIT License
178 stars 15 forks source link

ipv4.ip_forward not persisting #176

Closed Doosty closed 11 months ago

Doosty commented 11 months ago

I need to set this sysctl value but something is overriding it at reboot. Ive tried several different ways to set this value on bootup but nothing sticks. I would need to manually ssh into my pi and run sudo sysctl -p /etc/sysctl.d/99-tailscale.conf everytime my pi is restarted. Please advise me how to make these sysctl values persistant. Thank you.

net.ipv4.ip_forward = 1
net.ipv6.conf.all.forwarding = 1
Pack3tL0ss commented 11 months ago

@Doosty The AutoHotspot feature is disabling it. When no defined SSIDs are found and the ConsolePi goes into hotspot mode it enables ip forwarding. When it connects to a defined SSID it ensures the hotspot is disabled and disables ip forwarding.

You can disable autohotspot

I also just pushed an improvement in v2023-6.5. You can upgrade using consolepi-upgrade. I added logic to the autohotspot script that will look for net.ip.ip_forward = 1 in the sysctl files. It will only disable ip_forwarding if there is not configuration defined that enables it. So it should persist now with or without autohotspot enabled.

Doosty commented 11 months ago

Thank you for the reply and update, however

I have

Setting hotspot: false in /etc/ConsolePi/ConsolePi.yaml seems to work though. I dont need hotspot for now so it is ok. Thank you for the help.

Pack3tL0ss commented 11 months ago

Thanks for the update. I'll re-test. Get it it to work with hotspot enabled.

Pack3tL0ss commented 11 months ago

OK now (🔖 v2023-6.6) it should work with or without autohotspot.