All-in-One: How to set up a virtual external network completely inclosed within the host?
For a test setup of OpenStack, I followed http://openstack.redhat.com/PackStack_All-in-One_DIY_Configuration (PackStack All-in-One DIY Configuration) on a virtual machine running Scientific Linux 6. The machine is located in a corporate OpenStack cloud. It is not (easily) possible to get an address range within this network that could be used for an external network for the instances. Thus, I will not be able to contact instances from outside the host. But I want to contact instances from the host and I want that instances can reach the host and the internet.
To be more precise: Might the host's IP be
184.108.40.206 (that's just a random address and not my real one). For my test setup It is not possible to get IP addresses from
220.127.116.11/24 for the instances. The host has just one NIC:
eth0. I have set up a Neutron external network with the following properties
neutron subnet-create extnet --allocation-pool start=10.0.21.10,end=10.0.21.125 --gateway 10.0.21.1 --enable_dhcp=False 10.0.21.0/24
and an internal network with
neutron subnet-create rdonet 10.0.90.0/24
One of the instances has the _internal_ IP
10.0.90.4 and _external_ IP
I want to achieve that
- on the host I can run
ping 10.0.21.11to reach the instance via its external IP address.
- on the instance I want to be able to
ping 18.104.22.168to reach the host and something like
ping 22.214.171.124because I want to reach the internet.
As the configured external network is completely virtual, there is currently noone behind the gateway IP
10.0.21.1. Thus a
ping 10.0.21.1 from an instance or the namespace of the router gets lost in the network. This can be seen when running
ARP, Request who-has 10.0.21.1 tell 10.0.21.10, length 28
without getting an answer where
10.0.21.10 is the IP of the router.
What would be a good way to solve this? Create another router, interface or something else with OpenVSwitch and assign the gateway IP
10.0.21.1 to it? And then add a route to the host's routing table to tell him to which interface packets to
10.0.21.0/24 should go? Could I add a route that just says to route packets with target
Paste of some Configuration
Everything is in the same Gist https://gist.github.com/blipp/64639aad6149a54826ca (https://gist.github.com/blipp/64639aa...)
# ifconfig: https://gist.github.com/blipp/64639aad6149a54826ca#file-ifconfig-host (https://gist.github.com/blipp/64639aa...)
# ovs-vsctl show: https://gist.github.com/blipp/64639aad6149a54826ca#file-ovs-vsctl-show (https://gist.github.com/blipp/64639aa...) . I think
patch-tuncan be ignored for this question.
# route -n: https ...