Add Secondary IP Address to Centos Interface
This is super simple, just create a new interface file with a colon and a number.
/etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE=eth0:1
BOOTPROTO=static
IPADDR=192.168.0.5
ONBOOT=yes
This is super simple, just create a new interface file with a colon and a number.
/etc/sysconfig/network-scripts/ifcfg-eth0:1
DEVICE=eth0:1
BOOTPROTO=static
IPADDR=192.168.0.5
ONBOOT=yes
Copyright © 2024 Your Name Here. All rights reserved.
To activate it, just
# ifup eth0:1
Thanks
thanks , ifconfig eth0:1 x.x.x.x/24 up
NP
Im not sure if its only since CentOS 6, but you can also just add ‘IPADDR2’ to ifcfg-eth0.
So there is no need to add ifcfg-eth0:0
But perhaps there are other advantages of doing so.
But this also works, the server will listen on this IP too.
E.G, add this to the bottom of ifcfg-eth0
IPADDR2=192.168.1.2
PREFIX2=24
@Dean
Thanks for the update!
Thank you !!!!!!!!!!!!!