diff options
-rwxr-xr-x | adapt-ks-template | 12 | ||||
-rw-r--r-- | ks-template/hw/dell/R7425/100g-dtn.ks | 6 | ||||
-rw-r--r-- | ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks | 6 | ||||
-rwxr-xr-x | prep-boot-floppy-and-ks-config | 15 |
4 files changed, 37 insertions, 2 deletions
diff --git a/adapt-ks-template b/adapt-ks-template index 39fc977..e8f1eca 100755 --- a/adapt-ks-template +++ b/adapt-ks-template @@ -39,6 +39,7 @@ Options: --krnl-cmdline add stuff to destination system kernel cmdline --sec-ip IP of secondary interface --sec-nm Netmask of secondary interface + --sec-gw Gateway of secondary interface To avoid shell interpretation of whitespace in --krnl-cmdline use escaped semicolon: @@ -123,6 +124,10 @@ function parse_commadline { SecNM="${2}" shift ;; + --sec-gw) + SecGW="${2}" + shift + ;; -T|--tmp-dir) TmpDir="${2}" shift @@ -187,6 +192,12 @@ function check_options { print_usage exit 1 fi + if [ "x${SecGW}" = "x" ] + then + echo "${Self}: --sec-gw is mandatory" + print_usage + exit 1 + fi if [ "x${Kserver}" = "x" ] then Kserver="109.105.122.84" @@ -252,6 +263,7 @@ sed -ie "s/PRIGATEWAY/${GW}/g" "${TmpDir}/ks-template" sed -ie "s/PRINAMESERVERS/${NS}/g" "${TmpDir}/ks-template" sed -ie "s/SECIP/${SecIP}/g" "${TmpDir}/ks-template" sed -ie "s/SECNETMASK/${SecNM}/g" "${TmpDir}/ks-template" +sed -ie "s/SECGATEWAY/${SecGW}/g" "${TmpDir}/ks-template" sed -ie "s/KRNLCMDLINE/${KrnlCmdLineOpt}/g" "${TmpDir}/ks-template" sed -ie "s/BOOTDEV/${BootDev}/g" "${TmpDir}/ks-template" sed -ie "s/CLEARPART/${ClearPart}/g" "${TmpDir}/ks-template" diff --git a/ks-template/hw/dell/R7425/100g-dtn.ks b/ks-template/hw/dell/R7425/100g-dtn.ks index 60f643b..c44156b 100644 --- a/ks-template/hw/dell/R7425/100g-dtn.ks +++ b/ks-template/hw/dell/R7425/100g-dtn.ks @@ -72,6 +72,12 @@ yum install -y rngd systemctl enable rngd systemctl start rngd +# Set up secondary interface routing: +echo -e "1024\tmi-01" >>/etc/iproute2/rt_tables +echo "default table mi-01 via SECGATEWAY" \ + >/etc/sysconfig/network-scripts/route-p7p1 +echo "from SECGATEWAY table mi-01" >/etc/sysconfig/network-scripts/rule-p7p1 + # try to get access to the screen: #exec < /dev/tty6 > /dev/tty6 #chvt 6 diff --git a/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks b/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks index 5799d46..7ce4a9c 100644 --- a/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks +++ b/ks-template/hw/supermicro/SYS-5018D-FN8T/dtn-10g.ks @@ -68,6 +68,12 @@ yum install -y rngd systemctl enable rngd systemctl start rngd +# Set up secondary interface routing: +echo -e "1024\tmi-01" >>/etc/iproute2/rt_tables +echo "default table mi-01 via SECGATEWAY" \ + >/etc/sysconfig/network-scripts/route-eno8 +echo "from SECGATEWAY table mi-01" >/etc/sysconfig/network-scripts/rule-eno8 + # try to get access to the screen: #exec < /dev/tty6 > /dev/tty6 #chvt 6 diff --git a/prep-boot-floppy-and-ks-config b/prep-boot-floppy-and-ks-config index dd9779d..3f35113 100755 --- a/prep-boot-floppy-and-ks-config +++ b/prep-boot-floppy-and-ks-config @@ -52,6 +52,7 @@ Options: --krnl-cmdline add stuff to the destination system kernel command line --sec-ip IP of secondary interface --sec-nm Netmask of secondary interface + --sec-gw Gateway of secondary interface -h, --help this If --cosmos-hash is set to 'disabled', the kickstart stage should skip cosmos @@ -133,6 +134,10 @@ function parse_commadline { SecNM="${2}" shift ;; + --sec-gw) + SecGW="${2}" + shift + ;; --template) TemplateOpt="--template ${2}" shift @@ -202,6 +207,12 @@ function check_options { print_usage exit 1 fi + if [ "x${SecGW}" = "x" ] + then + echo "${Self}: --sec-gw is mandatory" + print_usage + exit 1 + fi if [ "x${CosmosHash}" = "x" ] then CosmosHash="2ea14b0b958fdc70ad37e3cb9b4185b3648137b8" @@ -249,8 +260,8 @@ ${ScriptPath}/create-boot-floppy -D ${Domain} -G ${GW} -H ${Host} \ ${ScriptPath}/adapt-ks-template -D ${Domain} -G ${GW} -H ${Host} \ -I ${IP} -M ${NM} -T ${TmpDir} -P ${PublishPath} --sec-ip ${SecIP} \ - --sec-nm ${SecNM} ${TemplateOpt} ${KrnlCmdLineOpt} ${CosmosTagOpt} \ - --gen-cmd ${SelfCommandLine} --boot-dev "${BootDev}" \ + --sec-nm ${SecNM} --sec-gw ${SecGW}${TemplateOpt} ${KrnlCmdLineOpt} \ + ${CosmosTagOpt} --gen-cmd ${SelfCommandLine} --boot-dev "${BootDev}" \ --root-dev "${RootDev}" # When this script calls the other two, PublishPath *is* set, so expect |