I am deploying OpenStack Havana over Ubuntu Server 12.04 LTS following the official documentation (http://docs.openstack.org/havana/install-guide/install/apt/content/index.html). I'm using a single-node installation, so one physical machine is acting as controller node and compute node at the same time.

Right now I have everything working except for the network. I should remark that I am not using Neutron, just Nova Network. Also, I should say I'm far from being a networking expert.

The problem is the next one: in my enterprise, as far as I know, every device has a public IP. This is, there are no IPs such as 192.168.X.X or 10.0.X.X. Rather, all IPs are located in a public subnet, to say, A.B.0.0/16. In particular, my department has the subnet A.B.C.0/24 assigned, so all our devices should be assigned an IP in that range. The gateway has assigned the IP A.B.C.2.

So far, I have not been able to configure the network correctly. What I would like to do is the following:

  • Using, nova network create, create a new network which is the same one that the physical machine:

    nova network-create vmnet --fixed-range-v4=A.B.C.0/24 --gateway=A.B.C.2 --dns1=8.8.8.8 --dns2=4.4.4.4
    
  • Then, assign IPs manually to each virtual machine. If IPs were assigned in that subnet, it would override other IPs from existing computers. So what I would like is doing pretty much what I can do with VirtualBox when I setup the adapter as a "Bridge Adapter", i.e., assigning an IP manually in the guest OS.

Is that even possible?

Thanks a lot.

有帮助吗?

解决方案

Use Neutron network and specifically go for ovs plugin. Because the instructions I am giving below will only work for it.

You have to setup the ovs plugin with the following configuration in '/etc/neutron/plugins/openvswitch/ovs_neutron_plugin.ini'

[OVS]
tenant_network_type = gre
network_vlan_ranges = EXTNet
enable_tunneling = True
tunnel_type = gre
tunnel_id_ranges = 1:1000
integration_bridge = br-int
tunnel_bridge = br-tun
bridge_mappings = EXTNet:br-ex
local_ip = <your machine IP here>

Note the Bridge mappings entry. It maps the EXTNet to br-ex. Later you will use this EXTNet as provider physical network while creating your network in Openstack. For now you have to add one of your host's interfaces that is connected to your enterprise networks to br-ex. After adding it you may not be able to access your host through that interface so always use a secondary interface for this.

Once you are done with the setup do the following.

quantum net-create EXTNet --provider:physical_network EXTNet --provider:network_type flat 
quantum net-update EXTNet --router:external True
quantum net-update EXTNet --shared True
quantum subnet-create --name EXTSubnet --gateway <external network gateway> EXTNet    <external network CIDR> --enable_dhcp False

There may be other ways of doing. But I have tested this approach and hence recommend.

Once you have successfully created a subnet, just lauch instances in it.

One thing to note here is since you have disabled dhcp in your subnet openstack will not run dnsmasq on it ahd hence you should have to provide your own dhcp server.

Second since the network_type is flat there wont be any vlan packets. The packets from your instance will flow as it is on your external network, which is what you want.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top