Linux – Insist on ifconfig lo multicast after reboot on Linux RHEL 6

Insist on ifconfig lo multicast after reboot on Linux RHEL 6… here is a solution to the problem.

Insist on ifconfig lo multicast after reboot on Linux RHEL 6

Is there a way to keep the following commands after a reboot on Linux RHEL 6 (except for the possibility of creating init.d scripts):

ifconfig lo multicast

I

have an app that needs to multicast on 127.0.0.1 and I was wondering if there is something in /etc/sysconfig/network-scripts that can help keep ifconfig lo multicast on reboot.

Thanks in advance.

Solution

Thanks to /etc/rc.local for the suggestion; It will work, and technically it’s not an init.d script, so in my humble opinion, -1 is a bit unfair. However, to improve the maintenance of the file, I want to avoid using this route as much as possible.

After some digging, I couldn’t find any useful files in /etc/sysconfig/network-scripts/; However, I did find a potential solution; After tracing the ifup script, there is a Hook that can call the ifup-${DEVICE} file; Since lo does not exist, I created an ifup-lo file with 755 permissions as follows:

/etc/sysconfig/network-scripts/ifup-lo

# ifconfig is deprecated; use ip link instead...
/sbin/ip link set lo multicast on
/sbin/ip link set lo up

This will be called by the operating system when ifup lo is called, allowing any custom hooks to be added.

Thanks for any better solution.

The ideal solution for Redhat is to add a MULTICAST=on or MULTICAST=off variable to /etc/ifcfg-lo, but since it is not yet, ifup-lo will be used for the time being….

Related Problems and Solutions