Add mkdummies script

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2024-08-23 15:08:07 +02:00
parent 852c2e4699
commit 87cdd8fa50
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57

5
linux/mkdummies.sh Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
# Create dummy interfaces based on ifcfg files
# Useful to test nftables after copying a production VM with many interfaces to a testing VM with only one
# Georg Pfuetzenreuter <mail+opensuse@georg-pfuetzenreuter.net>
for interface in $(find /etc/sysconfig/network/prod -type f -name 'ifcfg-*' -printf '%f '); do interface=$(echo $interface|sed s/ifcfg-//); ip l a $interface type dummy; ip l s up $interface; done