Chapter 2. VirtualBox Basics in OpenStack Training Guides ---> NAT network doesn't work

Bug #1342908 reported by Juan Manuel Sierra
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Training Guides
Invalid
Undecided
Unassigned

Bug Description

First of all: sorry for my english as it isn't my native language.

on this section:

        From your VM Instance, Use ping command to see whether Internet is on.

            $ping www.google.com

        If its not connected, restart networking service-

            $sudo service networking restart
            $ping www.google.com

of the OpenStack web http://docs.openstack.org/training-guides/content/lab000-virtualbox-basics.html

the problem doesn't solve just restarting the network service. The same problem happens on all virtual box VMs, and is (at least that's what i think), inside every VM, ubuntu starts NICs in the exact order they are declared. So that leads to an incorrect routing table, where it assumes that the first NIC (eth0) will be the default gateway so all the trafic goes to 10.10.10.1. that's why ping doesn't work.

this is what i get from command route -n

juan@Control-node:~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.10.10.1 0.0.0.0 UG 100 0 0 eth0
10.0.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
juan@Control-node:~$

so, in order to allow the NAT network adapter to work, i have to delete the default gateway and add the correct one (based on the previous output)

juan@Control-node:~$ route del default gw 10.10.10.1
juan@Control-node:~$ route add default gw 10.0.4.2 eth2

now the command route -n shows the correct information for this setup (again, based on the previous output)

root@Control-node:/home/juan# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 10.0.4.2 0.0.0.0 UG 0 0 0 eth2
10.0.4.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.100.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1

and now i can ping google

root@Control-node:/home/juan# ping www.google.com
PING www.google.com (173.194.42.51) 56(84) bytes of data.
64 bytes from eze03s06-in-f19.1e100.net (173.194.42.51): icmp_req=1 ttl=63 time=34.9 ms

summarizing:

the problem is: the NAT adapter is set by DHCP, and thus, the gateway depends on the network given to that particular MV by virtual Box. I don't know how to set up the ubuntu in order to take the as default gateway, the one that belongs to a especific NIC and it's given address space.

i haven't tried this, but i think maybe setting NAT NIC, as the first NIC adapter on every VM, could solve the problem. maybe that way ubuntu sees as eth0, the NAT adapter, and creates the right routing table.

I just hope to be helpful, and sorry for my poor english.

Regards from Argentina,
Juan M. Sierra.

-----------------------------------
Built: 2014-02-01T02:08:38 00:00
git SHA: 6c21ae8135000d53704ca5ab21f9388a3f3c1b1e
URL: http://docs.openstack.org/training-guides/content/lab000-virtualbox-basics.html
source File: file:/home/jenkins/workspace/openstack-training-guides/doc/training-guides/lab000-virtualbox-basics.xml
xml:id: lab000-virtualbox-basics

affects: openstack-manuals → openstack-training-guides
Revision history for this message
Pranav Salunke (dguitarbite) wrote :

This is due to incorrect default gateway. You need to delete the gateway in your case, which works for you.

# route -n
# route del -net 0.0.0.0 gw <IP corresponding to 0.0.0.0>
# route add -net 0.0.0.0 gw <IP of NAT interface>

This issue has been fixed earlier. It happens due to gateways set for vboxnet in the network interfaces configuration file.

Changed in openstack-training-guides:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.