Virtual IP


Introduction

I’m sure all of us know what the IP address is. You know people in the world or even the pets in your family all have at least one name to identify and communicate with each other. In the world of electronic devices, they’re the same. Each device has its name and the unique IP address needs to communicate with each other on the internet. In general, one IP address is assigned to one NIC (Network Interface Card), it means if a computer has more NICs, it has more IP addresses. The IP assigned to a NIC card is the real one. But what virtual IP and what’s it used for? Let see in this article.

Overview

Virtual IP is the second IP assigned to a computer but it’s not the real one. It doesn’t bind to any NIC actually. People use it in computer programming to serve some purposes without affecting the real IP. It can be added and removed again again and again. Accessing a computer can be performed using the real IP or virtual IP, they’re the same.

We usually see the virtual IP used in the High Availability and failover.

Virtual IP Usage

In a typical setup, multiple servers are grouped together under a single virtual IP, forming a server farm. When a client initiates a connection request, the virtual IP intelligently distributes the incoming traffic across the servers in the farm, promoting even resource utilization and preventing any single server from becoming a bottleneck.

In the event of a server failure, the virtual IP address can seamlessly redirect traffic to the remaining healthy servers, ensuring uninterrupted service. This process, known as failover, enhances the reliability and availability of applications and services.

The server here can be a webserver or a database server. You can see the illustration for a database below :

From the above picture, the IP addresses like 192.168.128.114, 192.168.128.115 and 192.168.128.116 are the real IPs assigned to 3 servers and 192.168.128.130 is the virtual IP assigned to the active server only.

The application accessing the database knows the virtual IP only which means it can issue a query or perform insert/update/delete operations to the database using the virtual IP.

When an active fails, one standby will become the new active and will be assigned the virtual IP 192.168.128.130, this makes the operations to the database never interrupted.

How to assign a virtual IP to a computer?

Virtual IP can be assigned to a computer using the ifconfig command in the Linux environment. If you don’t know how to do it, you can read the user manual of ifconfig or type ifconfig –help.

Conclusion

Virtual IP is usually used in modern IT infrastructures where the demand for flexibility, scalability, and high availability has driven the adoption of various technologies. Virtual IPs play a pivotal role in optimizing network resources, ensuring fault tolerance, and enabling seamless communication in dynamic environments.

Other support, please send email to support@openclovis.org.