How to make VMs on different compute nodes get IP addresses belonging to different sub-networks?

asked 2015-09-15 21:52:33 -0600

zhao01 gravatar image

Although the title may be long, my question is quite simple. I have 3 machines, denoted as A, B, and C. A is a router, having 3 network interfaces. B and C are client machines, having 1 network interface each. They are connected like this.

   | (eth0) <--> Internet
 A | (eth1) <--> (eth0) | B
   | (eth2) <--> (eth0) | C

After my configuration, A, B and C can all access the Internet and communicate with each other.

A's eth0 has an IP address of 192.168.11.1.
A's eth1 has an IP address of 192.168.12.1.
A's eth2 has an IP address of 192.168.13.1.
B's eth0 has an IP address of 192.168.12.2.
C's eth0 has an IP address of 192.168.13.2.

I have installed OpenStack Juno on these 3 machines, with A acting as the controller node while B and C acting as the compute nodes.

Now what I want is that

Any VM running on B has an IP address belonging to 192.168.12.0/24, starting from 192.168.12.3.
Any VM running on C has an IP address belonging to 192.168.13.0/24, starting from 192.168.13.3.

I have spent two days working on it, but still cannot figure it out. I tried both nova-network and neutron, and for neutron, I tried several configurations, including configuring A as the network node and configuring B and C as the network nodes. Now I even don't know whether it is doable or not.

Could anybody give me some guidance?

edit retag flag offensive close merge delete