VMware Communities
anarchos78
Contributor
Contributor

How to set a virtual ip on Vmware

I’m trying to setup a high availability failover on vmware (on a single machine - locally) for learning purposes using two Ubuntu 12.04 boxes and one virtual ip with no success.

Box1 listens on 192.168.59.131 [inet addr]

Box2 listens on 192.168.59.132 [inet addr]

My questions are:

  1. How do I set a virtual ip [global ip] on vmware workstation?
  2. How do I set an address like 192.168.59.133?
  3. After ipconfig on the host machine [Windows] I don’t see the inet addr of the two Ubuntu boxes [192.168.59.131, 192.168.59.132]. Why is that?

Under windows [the host machine] after issuing in cmd ipconfig I sow the following:

Wireless LAN adapter Wireless Network Connection:

   Connection-specific DNS Suffix  . :

   Link-local IPv6 Address . . . . . : fe80::e0d7:ca7f:5627:1db8%11

   IPv4 Address. . . . . . . . . . . : 192.168.2.4

   Subnet Mask . . . . . . . . . . . : 255.255.255.0

   Default Gateway . . . . . . . . . : 192.168.2.1

Ethernet adapter VMware Network Adapter VMnet1:

   Connection-specific DNS Suffix  . :

   Link-local IPv6 Address . . . . . : fe80::ac04:4d1f:201d:68de%20

   IPv4 Address. . . . . . . . . . . : 192.168.48.1

   Subnet Mask . . . . . . . . . . . : 255.255.255.0

   Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet8:

   Connection-specific DNS Suffix  . :

   Link-local IPv6 Address . . . . . : fe80::f569:a71a:2e4a:ad46%21

   IPv4 Address. . . . . . . . . . . : 192.168.59.1

   Subnet Mask . . . . . . . . . . . : 255.255.255.0

   Default Gateway . . . . . . . . . :

Ethernet adapter VMware Network Adapter VMnet2:

   Connection-specific DNS Suffix  . :

   Link-local IPv6 Address . . . . . : fe80::e530:581f:c87c:c4c8%30

   IPv4 Address. . . . . . . . . . . : 192.168.220.1

   Subnet Mask . . . . . . . . . . . : 255.255.255.0

   Default Gateway . . . . . . . . . :

Many thanks in advance

0 Kudos
12 Replies
weinstein5
Immortal
Immortal

Welcome to the Community - Each VM is a true machine and independent of the guest OS - so the Windows OS will not be aware of the IP addresses assigned to the VM machines - you will need a third VM that will act as firewall/network load balancer that will be assign the third IP address 192.168.59.133 that will redirect the traffic to the listener IP addresses -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
EV_Simon
Enthusiast
Enthusiast

As Weinstein5 mentioned you need a load balancer to do this (even in the world of full blown vSphere suite you need something to run as a load balancer).

0 Kudos
anarchos78
Contributor
Contributor

Many thanks for your reply. I am trying to replicate a setup like http://valeriytroshin.blogspot.gr/2011/09/implementing-failover-redundancy-in.html. The next thing to do is to make a high availability setup [3 Ubuntu boxes] with load balancing machines (referring to your suggestion to create a third VM as a load balancer). Is there a way not to create a third VM (as you suggested) in order to have the third IP address that i need to replicate the example setup above?

Many thanks again

0 Kudos
EV_Simon
Enthusiast
Enthusiast

See that's more HA than load balancer, what is it you're actually trying to do here?

I would follow the instructions posted on that link and see where that leads you.

0 Kudos
anarchos78
Contributor
Contributor

I don't want to use load balancer in my first "experimental" setup. Notice that I am doing this for educational purposes. Thanks. 

0 Kudos
EV_Simon
Enthusiast
Enthusiast

And as I said, what is it you're actually trying to do... If you don't want a load balancer but want to do HA then following that guide will give you HA.

Remember that there is a difference between a load balancer and a HA pair, it's in the name, one shares the load between the two VM's the other is a highly available application (in the case of the web link it's an Apache server), they are used for different purposes.

You don't explain what it is that you're trying to do with the VIP, depending on that answer will then determine the solution provided.

0 Kudos
weinstein5
Immortal
Immortal

The link talks about setting the virtual IP with in the Linux machines -

If you find this or any other answer useful please consider awarding points by marking the answer correct or helpful
0 Kudos
anarchos78
Contributor
Contributor

What I want is to use vmware to get familiar with HA. I think that I need to the virtual IP in order to run the above setup (web link) successfully. My goal is to learn (using vmware as learning tool) how to setup HA in real world - leasing two dedicated servers. These servers will host Mysql, Nginx, Apache httpd, Apache Tomcat with many app deployed using the above technologies. This moment I have all the above technologies hosted on one dedicated server. If an outage occurs or something get wrong with any of the above (Mysql, Apache, etc) the result would be unhappy users.

0 Kudos
anarchos78
Contributor
Contributor

Is that possible? How do i set two ips in one ubuntu installation?

0 Kudos
anarchos78
Contributor
Contributor

HA is what I need.

0 Kudos
anarchos78
Contributor
Contributor

What exactly I need is to have to two ubuntu boxes like: Box1 ip 192.168.1.130 (as master) and Box2 192.168.1.131. Listening requests from ip 192.168.1.132 and serve them from the master (Box1). If Box1 fails, Box2 take over. The requests must be served neither from 192.168.1.130 nor from 192.168.1.131but from 192.168.1.132 (virtual ip). Hope that I was clear enough.

0 Kudos
anarchos78
Contributor
Contributor

Many thanks for your precious help!

0 Kudos