Permanent dummy interface

General support questions
Post Reply
anderfo
Posts: 4
Joined: 2015/06/11 05:25:51

Permanent dummy interface

Post by anderfo » 2015/07/04 22:57:56

I want to permanently enable the configurations set by the following commands:
modprobe dummy
ip link set name ethdummy1 dev dummy0
ifconfig ethdummy1 hw ether 00:22:22:ff:ff:ff
ip address add 10.10.10.1/24 dev ethdummy1

Would entering these commands in rc.local be the correct way? Or is it better to create configuration files in network-scripts folder, or some other way?

User avatar
TrevorH
Forum Moderator
Posts: 29681
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Permanent dummy interface

Post by TrevorH » 2015/07/04 23:32:00

You can automate all of that.

Code: Select all

$ cat /etc/modules-load.d/dummy.conf
# Load dummy.ko at boot
dummy
$ cat /etc/modprobe.d/dummy.conf 
install dummy /sbin/modprobe --ignore-install dummy; /sbin/ip link set name ethdummy1 dev dummy0
$ cat /etc/sysconfig/network-scripts/ifcfg-ethdummy1
NAME=ethdummy1
DEVICE=ethdummy1
MACADDR=00:22:22:ff:ff:ff
IPADDR=10.10.10.1
NETMASK=255.255.255.0
ONBOOT=yes
TYPE=Ethernet
NM_CONTROLLED=no
CentOS 6 will die in November 2020 - migrate sooner rather than later!
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 is dead, do not use it.
Full time Geek, part time moderator. Use the FAQ Luke

anderfo
Posts: 4
Joined: 2015/06/11 05:25:51

Re: Permanent dummy interface

Post by anderfo » 2015/07/04 23:55:45

@TrevorH that worked great. Thank you.

Post Reply

Return to “CentOS 7 - General Support”