We currently run Suse servers and add the following to the loopback interface:
vi /etc/sysconfig/network/ifcfg-lo
# Loopback (lo) configuration
IPADDR=127.0.0.1/8
IPADDR_2=192.168.0.91/32
NETMASK=255.0.0.0
NETWORK=127.0.0.0
STARTMODE=nfsroot
BOOTPROTO=static
USERCONTROL=no
FIREWALL=no
We are migrating to Centos 7 and this does not work.
I have tried
vi /etc/sysconfig/network-scripts/ifcfg-lo:10
DEVICE=lo:10
BOOTPROTO=static
BROADCAST=192.168.0.255
HWADDR=00:0C:29:1E:DE:86
IPADDR=192.168.0.91
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
Restarted the network, it picks up the interface with ip addr, but still packets are not properly redirected.
How do i add the second ip (192.168.0.91) to the loopback of Centos 7
Best Answer
I was trying to route it back onto the 192.168.0.0 network instead of locally. I edited the interface as follows (note the network address of 127.0.0.0 instead of 192.168.0.0)
vi /etc/sysconfig/network-scripts/ifcfg-lo:10