Solaris (and other OS) allows the use of Virtual IP. Virtual interface or logical interface allows an Operating system with only one (1) network device to have multiple numbers of IP address.
The Problem
Got a page today, just now that one of our managed server went down. It’s a ping/connectivity page.
Logged in to console and investigate. It turns out that the UNIX box is multi-IP’d box. It has a virtual IP and looks like the one that gave out the ping notification is the virtual IP.
Corrective Action
Simple create the missing IP address using a virtual interface. Virtual interface allow a single ethernet interface to listen on additional IP addresses.
Check the existing network IP configuration of the UNIX box:
UNIX-Box(AP)#ifconfig -a
lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
qfe0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 165.20.21.4 netmask fffffff0 broadcast 65.201.212.47
ether 0:3:ba:3d:ba:99
qfe3: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 3
inet 12.3.55.22.6 netmask ffff0000 broadcast 172.31.255.255
ether 0:3:ba:3d:ba:99
You have to have the info you need to re-create the virtual IP. In this case, it’s the network IP: 12.3.55.22.12To create the Virtual interface:
ifconfig qfe0:1 plump
ifconfig qfe0:1 12.3.55.22.12 up
You can set the IP address of the interface to 192.168.1.15 and turn on the interface with the following command:ifconfig hme0:1 192.168.1.15 up
Unless you do some additional nonstandard things in your network, all of the subinterfaces on a physical interface need to be in the same subnet.
To make the virtual interface persist following a reboot, you can add the ip address or hostame from /etc/hosts in the file /etc/hostname.hme0:1
Disabling / Removing Virtual Interface
The example above shows how to create a virtual interface using the ‘plumb‘ command. In the same way, in order to remove a virtual interface (and subsequently the IP) the interface is unplumbed using the ‘unplumb’ directive.
To remove the virtual interface eri1:7, run the following command as root:
ifconfig eri1:7 unplumb
Final Words
Any other things we can do with virtual IP?