I followed a tutorial similar to this https://www.niftiestsoftware.com/2011/08/28/making-all-network-traffic-for-a-linux-user-use-a-specific-network-interface/
And started noticing that after a reboot the sysctl system settings weren't applied anymore, specifically these settings from /etc/sysctl.d/999-vpn.conf
(also tried putting them in the 99-sysctl.conf
file):
net.ipv4.conf.all.rp_filter = 2
net.ipv4.conf.default.rp_filter = 2
net.ipv4.conf.enx002427fe2be7.rp_filter = 2
This is the error in my syslog:
systemd-sysctl[289]: Couldn't write '2' to 'net/ipv4/conf/enx002427fe2be7/rp_filter', ignoring: No such file or directory
enx002427fe2be7
is the network interface name from my USB Network adapter that I use, and I'm guessing that the reason this fails is maybe because it hasnt been initialized yet when the sysctl
command runs.
So to fix this I tried an upstart
script, but even with exec sleep 60 && sysctl --system
this didn't seem to work.
Manually running sysctl --system
fixes it, but I'd rather have this automated.
What would be a proper way to fix this?
Using Ubuntu 16.04 LTS Server edition