Monday, July 19, 2021

Add dummy NIC as service

echo "MACADDR=56:12:b6:2a:aa:34" > /etc/sysconfig/dummy

vim /etc/systemd/system/dummy@.service 

# Remember to run `systemctl daemon-reload` after creating or editing this file.

[Unit]
Description=Dummy network interface for %i
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
EnvironmentFile=/etc/sysconfig/%i-dummy
ExecStartPre=/sbin/ip link add %i-dummy address ${MACADDR} type dummy

[Install]
WantedBy=multi-user.target
 
systemctl daemon-reload
systemctl enable dummy@foo.service
systemctl start dummy@foo.service


source:  https://jamielinux.com/docs/libvirt-networking-handbook/appendix/dummy-interface-on-fedora.html

No comments:

Post a Comment