Bug 2103517
Summary: | Adding file in sysctl.d fails to disable IPV6 | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | LinuxGeek46 <linuxgeek46> |
Component: | kernel | Assignee: | Kernel Maintainer List <kernel-maint> |
Status: | CLOSED EOL | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | medium | Docs Contact: | |
Priority: | unspecified | ||
Version: | 36 | CC: | acaringi, adscvr, airlied, alciregi, bskeggs, dtardon, fedoraproject, filbranden, flepied, gwync, hdegoede, hpa, jarodwilson, jglisse, jonathan, josef, kernel-maint, lgoncalv, linville, lnykryn, masami256, mchehab, msekleta, ptalbert, ryncsn, ssahani, s, steved, systemd-maint, yuwatana, zbyszek |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | x86_64 | ||
OS: | Linux | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2023-05-25 17:08:13 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: |
Description
LinuxGeek46@both.org
2022-07-04 00:01:56 UTC
Sorry, this is an essay, not a bug report. I'm can't figure out what issue you are trying to report. You have some race during configuration setting. Maybe it's that you set .default. after .all., maybe something else. sysctl doesn't support the full syntax of the config files, use systemd-sysctl instead. Try to use the same pattern as other settings in /usr/lib/sysctl.d/50-default.conf. I guess something like this should work: net.ipv6.conf.default.disable_ipv6 = 1 net.ipv6.conf.*.disable_ipv6 = 1 -net.ipv6.conf.all.disable_ipv6 Use 'systemd-analyze cat-config sysctl.d/' to check that you have the expected configuration and no stray files. I apologize sir - I do tend to be verbose. I was trying to ensure you had as much information as I could provide. I did try these statements in my file and they do work when I run sysctl --system. The following is the result of the systemd-analyze cat-config sysctl.d/ command. Other than disabling IPV6 redirects for XFRM/IPsec, the output below is the only other mention of IPV6. No stray files were found. # /etc/sysctl.d/99-local-network.conf ################################################################################ # Local Network settings - Specifically to disable IPV6 # # Install this file in the /etc/sysctl.d directory. # ################################################################################ # net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 Replacing my 2 lines with your 3 lines in my /etc/sysctl.d/99-local-network.conf file results in the same with IPV6 still activated. [root@f36vm ~]# nmcli enp0s3: connected to Wired connection 1 "Intel 82540EM" ethernet (e1000), 08:00:27:07:CD:FE, hw, mtu 1500 ip4 default inet4 192.168.0.136/24 route4 192.168.0.0/24 metric 100 route4 default via 192.168.0.254 metric 100 inet6 fe80::ffa4:fcef:19f7:8a5e/64 route6 fe80::/64 metric 1024 Even running sysctl --system from CLI with your 3 lines does not disable IPV6 although running that command with my 2 lines from CLI does disable IPV6. But the MyStartup.service does not disable IPV6 unless I add a delay before running the sysctl --system command in the script launched by the service. I agree that the problem is likely a race condition during late startup but that should not occur. I am happy to provide any additional information you need.Let me know how I can help. PS: I will research systemd-sysctl and let you know the results. Thx. FYI ... I have been experimenting with this recently. I have also found that attempting to set vm.swappiness this way does not work. However I have also discovered that using a new service ( Like rc,local ) MyStartup.service which waits 2 seconds and then runs MyStartup.sh successfully sets all needed kernelopts. I hope this information helps: [root@testvm3 system]# cat /etc/systemd/system/multi-user.target.wants/MyStartup.service #!/bin/bash ################################################################################ # MyStartup.service # # # # This file is the service unit file for MyStartup. It calls the script, # # /usr/local/bin/ MyStartup.sh which runs any commands or other scripts # # required at startup time. # # # # # # # # This program should be placed in /usr/local/lib/systemd/system/. # # Create a symlink to it from the /etc/systemd/system directory. # # # # Change History # # 2022/07/01 David Both Original code. # # # ################################################################################ ################################################################################ ################################################################################ # # # Copyright (C) 2022 David Both # # LinuxGeek46 # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # ################################################################################ ################################################################################ [Unit] Description=Runs /usr/local/bin/MyStartup.sh [Service] ExecStart=/usr/local/bin/MyStartup.sh [Install] WantedBy=multi-user.target ################################################################################ ################################################################################ [root@testvm3 system]# cat /usr/local/bin/MyStartup.sh #!/bin/bash ################################################################################ # MyStartup.sh # # # # This script is used during systemd startup or from the command line to # # run local startup commands and scripts as necessary. It can be run from the # # command line but should be run as a systemd service at Linux startup. # # # # This file should be located in /usr/local/bin. # # # # This file is called by the local MyStartup.service during Linux startup. # # # # Change History # # 2022/07/01 David Both Original code. # # # # # ################################################################################ ################################################################################ ################################################################################ # # # Copyright (C) 2022 David Both # # LinuxGeek46 # # # # This program is free software; you can redistribute it and/or modify # # it under the terms of the GNU General Public License as published by # # the Free Software Foundation; either version 2 of the License, or # # (at your option) any later version. # # # # This program is distributed in the hope that it will be useful, # # but WITHOUT ANY WARRANTY; without even the implied warranty of # # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # # GNU General Public License for more details. # # # # You should have received a copy of the GNU General Public License # # along with this program; if not, write to the Free Software # # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # # ################################################################################ ################################################################################ ################################################################################ # Place your startup commands here. ################################################################################ # Activate all kernelopts files in /etc/sysctl.d # ################################################################################ sleep 2 sysctl -p /etc/sysctl.d/* ################################################################################ The settings are applied by systemd-sysctl on boot, as can be checked by # cat /proc/sys/net/ipv6/conf/default/disable_ipv6 or # sysctl -n net.ipv6.conf.all.disable_ipv6 . But the .default. setting is only applied to interfaces created after that. The .all. setting should affect all existing interfaces, but it seems it doesn't -> moving to kernel for investigation. This message is a reminder that Fedora Linux 36 is nearing its end of life. Fedora will stop maintaining and issuing updates for Fedora Linux 36 on 2023-05-16. It is Fedora's policy to close all bug reports from releases that are no longer maintained. At that time this bug will be closed as EOL if it remains open with a 'version' of '36'. Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, change the 'version' to a later Fedora Linux version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see it. Thank you for reporting this issue and we are sorry that we were not able to fix it before Fedora Linux 36 is end of life. If you would still like to see this bug fixed and are able to reproduce it against a later version of Fedora Linux, you are encouraged to change the 'version' to a later version prior to this bug being closed. Fedora Linux 36 entered end-of-life (EOL) status on 2023-05-16. Fedora Linux 36 is no longer maintained, which means that it will not receive any further security or bug fix updates. As a result we are closing this bug. If you can reproduce this bug against a currently maintained version of Fedora Linux please feel free to reopen this bug against that version. Note that the version field may be hidden. Click the "Show advanced fields" button if you do not see the version field. If you are unable to reopen this bug, please file a new report against an active release. Thank you for reporting this bug and we are sorry it could not be fixed. |