Recently I needed bring two dummy interfaces on Oracle Linux 8 (standard 4.18 kernel). Automatic cleaning config files don't critical for me and I used Oleg's idea and theirs script on first post this thread and script for NetworkManager from the article Dummy interface on RHEL and wrote two simple scripts for bring up with startup two dummy interfaces
Created two script - for example 98-dummy0 and example 99-dummy1- in /etc/NetworkManager/dispatcher.d/ directory:
98-dummy0
#!/bin/sh # See the "DISPATCHER SCRIPTS" section of `man NetworkManager`. # Remember to make this file executable! # Create the dummy interface. /sbin/ip link add dummy0 type dummy /sbin/ip link set dummy0 multicast on /sbin/ip addr add 10.10.0.1/24 dev dummy0 /sbin/ip link set dummy0 up
For 99-dummy1 change IP adress to 10.10.0.2/24 and rename to dummy1.
Reboot and check
[mvg@oracle ~]$ ifconfig dummy0: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST> mtu 1500 inet 10.10.0.1 netmask 255.255.255.0 broadcast 0.0.0.0 inet6 fe80::e4b7:27ff:fe33:73e9 prefixlen 64 scopeid 0x20<link> ether e6:b7:27:33:73:e9 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 84 bytes 10858 (10.6 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 dummy1: flags=4291<UP,BROADCAST,RUNNING,NOARP,MULTICAST> mtu 1500 inet 10.10.0.2 netmask 255.255.255.0 broadcast 0.0.0.0 inet6 fe80::7c8a:e7ff:feee:b648 prefixlen 64 scopeid 0x20<link> ether 7e:8a:e7:ee:b6:48 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 78 bytes 10306 (10.0 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 enp3s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.131 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fdb0:34c:6e16:0:a01e:6127:6aa7:1bba prefixlen 64 scopeid 0x0<global> inet6 fe80::2cd7:76d7:c757:6b30 prefixlen 64 scopeid 0x20<link> ether 94:de:80:07:50:d2 txqueuelen 1000 (Ethernet) RX packets 15759 bytes 14474446 (13.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 11577 bytes 1411688 (1.3 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 112 bytes 9480 (9.2 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 112 bytes 9480 (9.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255 ether 52:54:00:6b:09:b3 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Either dummy interface pinged.