Discussion Locked

add virtual ip addresses to red hat 8

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi i have linux red hat 8, and i want to be able to add multiple ip addresses on the same nic (virtual ip addresses). Does anybody know how?

thanks,

jh

4 replies

by sachuv

Hi

Adding virtual IP address is simple on Linux/Unix box.

#ifconfig eth0:1 192.168.1.1 up

eth0:1 -> logical interface
192.168.1.1 -> virtual IP

by Member 36395912

It is called multi-homing. It is supported by everybody--including MS. The guy above answered it. I just wanted to give you the key words to use should you need more help.

by penguinvitamins2

Interface configurations are stored in /etc/sysconfig/network-scripts/ifcfg-[cardname]
The machine's first Ethernet network interface is eth0 and is stored in /etc/sysconfig/network-scripts/ifcfg-eth0

Virtual IP addresses are specified with a column ?:? and a number e.g. eth0:1, eth0:2, eth1:1

To create a virtual address simply copy the file ifcfg-eth0 to ifcfg-eth0:1
cp -a ifcfg-eth0 ifcfg-eth0:1
Now edit the new file and change the name to the virtual name
e.g. DEVICE=eth0 to DEVICE=eth0:1
Change the other lines according to your requirements.

Bring the new interface up:
ifup eth0:1

And to display it:
ifconfig eth0:1

This discussion is closed to new replies.