misc/linux/mkdummies.sh
Georg Pfuetzenreuter 87cdd8fa50
Add mkdummies script
Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
2024-08-23 15:08:07 +02:00

6 lines
425 B
Bash
Executable File

#!/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