netplan breaks route_localnet set in /proc/sys/net/ipv4/conf after apply/try

Bug #2069111 reported by Fero Tapeta
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Netplan
Triaged
Undecided
Unassigned

Bug Description

Hello,

VERSION: 0.106-2+deb12u1

Our server provider uses netplan so I've tried to migrate our configuration to netplan. We use internally developed transparent proxy similar to https://github.com/cloudflare/mmproxy/. For the proper functionality route_localnet must be enabled on the interface - echo 1 > /proc/sys/net/ipv4/conf/ens3/route_localnet

After restarting network using 'netplan apply' or 'netplan try' the setting resets back to 0 and routing become broken.

I've tried using networkd-dispatcher and putting script to routable.d and seems it executes BEFORE netplan reset to setting back to 0 so the result is not as intended - interface will keep set at 0 at the end.

Therefore, We had to go back to ifupdown and use post-up/post-down scripts to setup everything properly.

Revision history for this message
Danilo Egea Gondolfo (danilogondolfo) wrote :

Hello,

netplan doesn't touch that file, not sure why it gets reset. networkd might be the one responsible for that.

Have you tried to do that with sysctl?

Can you try to create a file like /etc/sysctl.d/99-ens3.conf with the following content:

net.ipv4.conf.ens3.route_localnet = 1

You can also add it to /etc/sysctl.conf

In my tests (on Ubuntu) this setting doesn't get reset after netplan apply.

Changed in netplan:
status: New → Triaged
Revision history for this message
Fero Tapeta (gunzo) wrote :

Hello Danilo,

Probably you're right, the issue could be somewhere else. Maybe it could be that netplan is flushing routing tables and GRE tunnels which are created outside of netplan?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.