From 11b22ea95f0268f322bd085989e4fcd0780b1399 Mon Sep 17 00:00:00 2001 From: Frank Brehm Date: Mon, 4 Apr 2022 09:33:36 +0200 Subject: [PATCH] Disabling IPv6 in GRUB --- lib/cr_vmware_tpl/handler.py | 12 ++++++++++++ snippets/tpl.070.tweak_grub.sh | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index 8dc2bb3..fbfaa05 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -891,6 +891,18 @@ class CrTplHandler(BaseHandler): cp /dev/null "${f}" fi done + + echo + echo "-----------------------------------------------------------" + echo "Current network configuration:" + echo + /usr/sbin/ip address show + echo + echo "Current routing configuration:" + echo + /usr/sbin/ip route show + echo + """).replace('@@@LOGFILES@@@', ' '.join(logfiles)) result = self.exec_remote(cmd) diff --git a/snippets/tpl.070.tweak_grub.sh b/snippets/tpl.070.tweak_grub.sh index 06b924a..fb27240 100644 --- a/snippets/tpl.070.tweak_grub.sh +++ b/snippets/tpl.070.tweak_grub.sh @@ -24,6 +24,14 @@ tweak_grub() { echo "Removing rhgb (RedHat Graphical Boot) from '${grub_cfg}' ..." sed --in-place -e 's/^\(GRUB_CMDLINE_LINUX=.*\)[ ]rhgb\(.*\)/\1\2/' "${grub_cfg}" + echo "Disabling IPv6 in '${grub_cfg}' ..." + sed --in-place -e 's/^\(GRUB_CMDLINE_LINUX=.*\)"$/\1 ipv6.disable=1"/' "${grub_cfg}" + + echo + echo "Current Linux command line in '${grub_cfg}':" + grep '^GRUB_CMDLINE_LINUX=' "${grub_cfg}" + echo + echo "Recreating /boot/grub2/grub.cfg ..." grub2-mkconfig -o /boot/grub2/grub.cfg -- 2.39.5