
Viewing the virtual interface information on the Network node
The previous recipe showed you how to identify the VIF information on the compute node. Now let's turn our attention to the Network node.
While a virtual machine is instantiated on a compute node, the DHCP server for the entire tenant Network is started on the Network node. As multiple tenant networks can have overlapping IP addresses, the Network node uses the concept of namespaces to isolate one Network from the other.
Getting ready
As this recipe is described from the point of view of an administrator troubleshooting a tenant problem, the following information is required:
- The tenant Network name
- The virtual machine instance whose VIF information is to be identified
How to do it…
The previous recipe showed you how to view the ports associated with a Network on the Network Detail screen. This recipe shows you how to look for the DHCP-related information on the Network node:
- In the left navigation menu, click on Admin | System | Networks. Click on the name of the Network to view the details of the network to which the virtual machine instance belongs.
- In the details of the Network, we can see the Ports associated with this Network. The DHCP Port for the selected network is highlighted as follows:
- Click on the Port name to view the DHCP Port Detail. Note that the DHCP IP address is 70.70.70.3 and the Port ID starts with 18cc6f06-2b as highlighted here:
- Now log in to the network node of your setup (the Controller and Network node of our setup for this chapter) with the appropriate credentials and execute the following command:
openstack@controller:~$ ip netns qdhcp-bd09066a-eafe-4241-a7b4-bc9d8056d82b
- The output of the
ip netns
command lists all the Linux namespaces created on the node. In our setup, we can see a namespace calledqdhcp-bd09066a-eafe-4241-a7b4-bc9d8056d82b
. This name is generated by Neutron by addingqdhcp
and the unique ID for the Network. - To view the networking information and applications running in a namespace, we will need to start a command shell in the namespace. You can do this using the following command:
openstack@controller:~$ sudo ip netns exec qdhcp-bd09066a-eafe-4241-a7b4-bc9d8056d82b /bin/bash
- Once this command is successful, you will get a new shell prompt. All the commands executed at this shell prompt are restricted to that namespace. Let's type the following
ifconfig
command at the prompt: - In the output of the
ifconfig
command, we can see an interface calledtap18cc6f06-2b
. You will notice that18cc6f06-2b
matches the first few characters of the DHCP port ID that we noted in step 3. - Neutron uses
dnsmasq
to provide DHCP services. We can confirm that thednsmasq
process is using thetap18cc6f06-2b
interface with theps
command as shown here: - Next, we will check how the
tap18cc6f06-2b
interface is connected to the external physical network. For this, we will exit the namespace shell prompt and execute the followingovs-vsctl show
command on the controller shell: - As seen in the preceding output, the
tap18cc6f06-2b
interface is bound to the OVS bridge,br-eth1
. This in turn uses theeth1
physical interface of the network node. - As seen in the previous recipe, we can execute
the ovs-ofctl dump-flows br-int
command to confirm that the DHCP port is also using VLAN 1002 that was assigned to the tenant network.
How it works…
Namespaces are constructs in Linux that allows the users to create a copy of a full TCP/IP network stack including interfaces and routing tables. In the OpenStack networking, one DHCP server is started for each Network and an IP address from the corresponding subnet is assigned to the DHCP server. As the tenant networks can have similar or overlapping IP addresses, Neutron uses namespaces to isolate each DHCP server.
As we saw in the previous recipe, Neutron uses unique IDs to identify the physical and virtual network information. The namespace name contained the unique ID of the tenant network. Moreover, the interface used by the DHCP server contained the unique ID of the Network port.