Virtual IP address on RedHat 6

7,809

you are looking for an alias.

assuming your IP on eth0 is 192.168.230.128, you can have an alias either by

  • setting ifcfg-eth0:1 (/etc/sysconfig/network-script)

    DEVICE="eth0:1"
    BOOTPROTO="static"
    IPADDR=192.168.230.253
    NETWORK=192.168.230.0
    NETMASK=255.255.255.0
    IPV6INIT="yes"
    NM_CONTROLLED="yes"
    ONBOOT="yes"
    
  • or at run time

    ifconfig eth0:1 192.168.230.253/24 up
    

former method will work from boot, latter at run time only (and will be lost on reboot).

Share:
7,809

Related videos on Youtube

BalaB
Author by

BalaB

Updated on September 18, 2022

Comments

  • BalaB
    BalaB over 1 year

    I have server (A) running with a static IP address (xx.xxx.xxx.xxx) in my company. I need to assign virtual IP address to this Server (A). My production team expects script file where they can execute to up / down VIP (Virtual IP). I tried googling but end with Create Virtual IP, I don't have access. Looking for expert advice on, how to create and assign Virtual IP address to existing server?

    Note : Currently we have one prod server and one DR server. We may be scaling it up in future.

    Environment : Redhat 6