Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sysctl.d: Add prefix 60 to baselayout.conf and set rp_filter values #13

Merged
merged 1 commit into from Dec 15, 2020

Conversation

pothos
Copy link
Member

@pothos pothos commented Dec 14, 2020

The baselayout.conf file was applied after all "[0-9]+.*.conf" files
due to sorting by file name. This made it difficult for users to apply
their configuration files because they had to use a name starting with
something being sorted after "bb" while everybody expects "90" to be
the latest in the order. This also caused that baselayout was
overwriting the "50-default.conf" file from systemd.
Sort the baselayout file after the "50-default.conf" file but before
any possible user files like "90-...". By inserting the baselayout file
after "50-default.conf" we have a good way to overwrite the systemd
settings for rp_filter that we want to change to 0. This allows us to
drop any patches to the systemd ebuild file.

Note: Pick for 2605 and 2705

How to use

Build an image and check that sudo sysctl -a | grep '\.rp_filter' reports = 0 for every line.

Testing done

Done here

The baselayout.conf file was applied after all "[0-9]+.*.conf" files
due to sorting by file name. This made it difficult for users to apply
their configuration files because they had to use a name starting with
something being sorted after "bb" while everybody expects "90" to be
the latest in the order. This also caused that baselayout was
overwriting the "50-default.conf" file from systemd.
Sort the baselayout file after the "50-default.conf" file but before
any possible user files like "90-...". By inserting the baselayout file
after "50-default.conf" we have a good way to overwrite the systemd
settings for rp_filter that we want to change to 0. This allows us to
drop any patches to the systemd ebuild file.
@pothos pothos requested a review from a team December 14, 2020 19:42
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 14, 2020
The patches were not taking effect because they did not set
net.ipv4.conf.default.rp_filter for new interfaces. Also, they got
overwritten by the baselayout configuration which takes precedence
and is the place for Flatcar-specific sysctl settings.
The desired configuration was enfored there:
flatcar/baselayout#13
@pothos
Copy link
Member Author

pothos commented Dec 15, 2020

Test results:

core@localhost ~ $ sudo sysctl -a | grep '\.rp_filter'
net.ipv4.conf.all.rp_filter = 0
net.ipv4.conf.default.rp_filter = 0
net.ipv4.conf.eth0.rp_filter = 0
net.ipv4.conf.lo.rp_filter = 0

Copy link
Member

@t-lo t-lo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pothos
Copy link
Member Author

pothos commented Dec 15, 2020

For promote_secondaries and accept_source_route the defaults are and were used – the patches in flatcar/coreos-overlay#746 did first change them but then changed them back again.

pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 15, 2020
The patches were not taking effect because they did not set
net.ipv4.conf.default.rp_filter for new interfaces. Also, they got
overwritten by the baselayout configuration which takes precedence
and is the place for Flatcar-specific sysctl settings.
The desired configuration was enfored there:
flatcar/baselayout#13
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 15, 2020
The patches were not taking effect because they did not set
net.ipv4.conf.default.rp_filter for new interfaces. Also, they got
overwritten by the baselayout configuration which takes precedence
and is the place for Flatcar-specific sysctl settings.
The desired configuration was enfored there:
flatcar/baselayout#13
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 15, 2020
The patches were not taking effect because they did not set
net.ipv4.conf.default.rp_filter for new interfaces. Also, they got
overwritten by the baselayout configuration which takes precedence
and is the place for Flatcar-specific sysctl settings.
The desired configuration was enfored there:
flatcar/baselayout#13
@t-lo t-lo self-requested a review December 15, 2020 10:44
t-lo
t-lo approved these changes Dec 15, 2020
Copy link
Member

@t-lo t-lo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for clarifying; LGTM then.

@pothos pothos merged commit 69ed7c7 into flatcar-master Dec 15, 2020
@pothos pothos deleted the kai/baselayout-sysctl-order branch December 15, 2020 10:47
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 15, 2020
This pulls in
flatcar/baselayout#13
to set sysctl rp_filter=0 and reorder how the configs are applied.
pothos added a commit that referenced this pull request Dec 15, 2020
sysctl.d: Add prefix 60 to baselayout.conf and set rp_filter values
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 15, 2020
This pulls in
flatcar/baselayout#13
to set sysctl rp_filter=0 and reorder how the configs are applied.
A branch flatcar-2605-2705 is used as maitenance branch.
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 15, 2020
This pulls in
flatcar/baselayout#13
to set sysctl rp_filter=0 and reorder how the configs are applied.
A branch flatcar-2605-2705 is used as maintenance branch.
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 15, 2020
This pulls in
flatcar/baselayout#13
to set sysctl rp_filter=0 and reorder how the configs are applied.
A branch flatcar-2605-2705 is used as maintenance branch.
pothos added a commit to flatcar/coreos-overlay that referenced this pull request Dec 15, 2020
This pulls in
flatcar/baselayout#13
to set sysctl rp_filter=0 and reorder how the configs are applied.
A branch flatcar-2605-2705 is used as maintenance branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants