User Tools

Site Tools


redhat_-_network:setup_virtual_ip

This is an old revision of the document!


Redhat - Network - Setup virtual IP

A virtual IP is an ip that bind to a physical ethernet card that already has a physical ip address.

1. Add virtual ip to eth0.

Here is the original configuration of /etc/sysconfig/network-scripts/ifcfg-eth0. ifcfg-eth0 is the original configuration file for eth0.

vi /etc/sysconfig/network-scripts/ifcfg-eth0
/etc/sysconfig/network-scripts/ifcfg-eth0
BOOTPROTO=static
BROADCAST=192.168.0.255
HWADDR=00:0C:29:C8:AA:7C
IPADDR=192.168.0.10
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
TYPE=Ethernet

2. Create a new virtual configuration file by copying and editing the ifcfg-eth0 configuration file.

Change the IPADDR and remove HWADDR.

cd /etc/sysconfig/network-scripts
cp ifcfg-eth0 ifcfg-eth0:0
vi ifcfg-eth0:0
ifcfg-eth0:0
BOOTPROTO=static
BROADCAST=192.168.0.255
IPADDR=192.168.0.11
NETMASK=255.255.255.0
NETWORK=192.168.0.0
ONBOOT=yes
TYPE=Ethernet

3. Restart network

/etc/init.d/network restart

4. Check your new virtual ip using ifconfig

ifconfig
redhat_-_network/setup_virtual_ip.1594805433.txt.gz ยท Last modified: 2020/07/15 09:30 by 127.0.0.1

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki