Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Liberty - Neutron router have no ip

Hi,

I'm trying to install an Openstack test environment with 3 nodes. I installed the controller, the network and the compute server. When I create my network, my router and a Cirros VM, the instance get an IP address, but can't ping the default gateway (but can ping the dns server).

### ifconfig -a
eth0      Link encap:Ethernet  HWaddr FA:16:3E:7E:05:89  
          inet addr:10.0.0.3  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::f816:3eff:fe7e:589/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:27 errors:0 dropped:0 overruns:0 frame:0
          TX packets:77 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2735 (2.6 KiB)  TX bytes:4257 (4.1 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:42 errors:0 dropped:0 overruns:0 frame:0
          TX packets:42 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3720 (3.6 KiB)  TX bytes:3720 (3.6 KiB)

### route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.0.1        0.0.0.0         UG    0      0        0 eth0
10.0.0.0        0.0.0.0         255.255.255.0   U     0      0        0 eth0
### cat /etc/resolv.conf
search openstacklocal
nameserver 10.0.0.2
### ping -c 5 10.0.0.1
PING 10.0.0.1 (10.0.0.1): 56 data bytes

--- 10.0.0.1 ping statistics ---
5 packets transmitted, 0 packets received, 100% packet loss
### pinging nameservers
#### ping -c 5 10.0.0.2
PING 10.0.0.2 (10.0.0.2): 56 data bytes
64 bytes from 10.0.0.2: seq=0 ttl=64 time=1.128 ms
64 bytes from 10.0.0.2: seq=1 ttl=64 time=0.364 ms
64 bytes from 10.0.0.2: seq=2 ttl=64 time=0.361 ms
64 bytes from 10.0.0.2: seq=3 ttl=64 time=0.352 ms
64 bytes from 10.0.0.2: seq=4 ttl=64 time=0.373 ms

When I check the network configurations inside my two namespaces (dhcp and router), I see that the router have no ip.

root@neumann:/etc/neutron# ip netns exec qrouter-283061e5-4b60-451f-b7cf-1862bb85f1f2 ip a
1: lo: <loopback,up,lower_up> mtu 65536 qdisc noqueue state UNKNOWN group default 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

But I can see the good iptables rules inside the same namespace

root@neumann:/etc/neutron# ip netns exec qrouter-283061e5-4b60-451f-b7cf-1862bb85f1f2 iptables-save
# Generated by iptables-save v1.4.21 on Fri Nov 20 16:16:23 2015
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:neutron-filter-top - [0:0]
:neutron-l3-agent-FORWARD - [0:0]
:neutron-l3-agent-INPUT - [0:0]
:neutron-l3-agent-OUTPUT - [0:0]
:neutron-l3-agent-local - [0:0]
-A INPUT -j neutron-l3-agent-INPUT
-A FORWARD -j neutron-filter-top
-A FORWARD -j neutron-l3-agent-FORWARD
-A OUTPUT -j neutron-filter-top
-A OUTPUT -j neutron-l3-agent-OUTPUT
-A neutron-filter-top -j neutron-l3-agent-local
-A neutron-l3-agent-INPUT -d 127.0.0.1/32 -p tcp -m tcp --dport 9697 -j ACCEPT
COMMIT
# Completed on Fri Nov 20 16:16:23 2015
# Generated by iptables-save v1.4.21 on Fri Nov 20 16:16:23 2015
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:neutron-l3-agent-OUTPUT - [0:0]
:neutron-l3-agent-POSTROUTING - [0:0]
:neutron-l3-agent-PREROUTING - [0:0]
:neutron-l3-agent-float-snat - [0:0]
:neutron-l3-agent-snat - [0:0]
:neutron-postrouting-bottom - [0:0]
-A PREROUTING -j neutron-l3-agent-PREROUTING
-A OUTPUT -j neutron-l3-agent-OUTPUT
-A POSTROUTING -j neutron-l3-agent-POSTROUTING
-A POSTROUTING -j neutron-postrouting-bottom
-A neutron-l3-agent-PREROUTING -d 169.254.169.254/32 -p tcp -m tcp --dport 80 -j REDIRECT --to-ports 9697
-A neutron-l3-agent-snat -j neutron-l3-agent-float-snat
-A neutron-postrouting-bottom -j neutron-l3-agent-snat
COMMIT

Project Networking

(neutron) net-list
+--------------------------------------+-------+--------------------------------------------------+
| id                                   | name  | subnets                                          |
+--------------------------------------+-------+--------------------------------------------------+
| 946bf2b2-a4fe-44c5-8d9e-11fb6cc9fe45 | local | 7a7a1d3a-bd9a-44f6-9c4b-f62b4d7ec33c 10.0.0.0/24 |
+--------------------------------------+-------+--------------------------------------------------+
(neutron) net-show
show
(neutron) net-show local
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | True                                 |
| id                        | 946bf2b2-a4fe-44c5-8d9e-11fb6cc9fe45 |
| mtu                       | 0                                    |
| name                      | local                                |
| provider:network_type     | gre                                  |
| provider:physical_network |                                      |
| provider:segmentation_id  | 20                                   |
| router:external           | False                                |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   | 7a7a1d3a-bd9a-44f6-9c4b-f62b4d7ec33c |
| tenant_id                 | 3d811c47313644faaa6b523129b2f334     |
+---------------------------+--------------------------------------+
(neutron) subnet-show 10-0-0-0-ipv4
+-------------------+--------------------------------------------+
| Field             | Value                                      |
+-------------------+--------------------------------------------+
| allocation_pools  | {"start": "10.0.0.2", "end": "10.0.0.254"} |
| cidr              | 10.0.0.0/24                                |
| dns_nameservers   |                                            |
| enable_dhcp       | True                                       |
| gateway_ip        | 10.0.0.1                                   |
| host_routes       |                                            |
| id                | 7a7a1d3a-bd9a-44f6-9c4b-f62b4d7ec33c       |
| ip_version        | 4                                          |
| ipv6_address_mode |                                            |
| ipv6_ra_mode      |                                            |
| name              | 10-0-0-0-ipv4                              |
| network_id        | 946bf2b2-a4fe-44c5-8d9e-11fb6cc9fe45       |
| subnetpool_id     |                                            |
| tenant_id         | 3d811c47313644faaa6b523129b2f334           |
+-------------------+--------------------------------------------+
(neutron) router-show gateway
+-----------------------+--------------------------------------+
| Field                 | Value                                |
+-----------------------+--------------------------------------+
| admin_state_up        | True                                 |
| distributed           | False                                |
| external_gateway_info |                                      |
| ha                    | False                                |
| id                    | 283061e5-4b60-451f-b7cf-1862bb85f1f2 |
| name                  | gateway                              |
| routes                |                                      |
| status                | ACTIVE                               |
| tenant_id             | 3d811c47313644faaa6b523129b2f334     |
+-----------------------+--------------------------------------+
(neutron) port-list
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
| id                                   | name | mac_address       | fixed_ips                                                                       |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
| 20bc169a-1e67-43fd-be15-3f517aadb54b |      | fa:16:3e:83:54:b6 | {"subnet_id": "7a7a1d3a-bd9a-44f6-9c4b-f62b4d7ec33c", "ip_address": "10.0.0.1"} |
| d3f62ef3-9acc-4573-92dc-d736e75319bf |      | fa:16:3e:a1:b6:1f | {"subnet_id": "7a7a1d3a-bd9a-44f6-9c4b-f62b4d7ec33c", "ip_address": "10.0.0.2"} |
+--------------------------------------+------+-------------------+---------------------------------------------------------------------------------+
(neutron) port-show 20bc169a-1e67-43fd-be15-3f517aadb54b
+-----------------------+--------------------------------------------------------------------------------------------------+
| Field                 | Value                                                                                            |
+-----------------------+--------------------------------------------------------------------------------------------------+
| admin_state_up        | True                                                                                             |
| allowed_address_pairs |                                                                                                  |
| binding:host_id       | neumann                                                                                          |
| binding:profile       | {}                                                                                               |
| binding:vif_details   | {"port_filter": true, "ovs_hybrid_plug": true}                                                   |
| binding:vif_type      | ovs                                                                                              |
| binding:vnic_type     | normal                                                                                           |
| device_id             | 283061e5-4b60-451f-b7cf-1862bb85f1f2                                                             |
| device_owner          | network:router_interface                                                                         |
| dns_assignment        | {"hostname": "host-10-0-0-1", "ip_address": "10.0.0.1", "fqdn": "host-10-0-0-1.openstacklocal."} |
| dns_name              |                                                                                                  |
| extra_dhcp_opts       |                                                                                                  |
| fixed_ips             | {"subnet_id": "7a7a1d3a-bd9a-44f6-9c4b-f62b4d7ec33c", "ip_address": "10.0.0.1"}                  |
| id                    | 20bc169a-1e67-43fd-be15-3f517aadb54b                                                             |
| mac_address           | fa:16:3e:83:54:b6                                                                                |
| name                  |                                                                                                  |
| network_id            | 946bf2b2-a4fe-44c5-8d9e-11fb6cc9fe45                                                             |
| security_groups       |                                                                                                  |
| status                | DOWN                                                                                             |
| tenant_id             | 3d811c47313644faaa6b523129b2f334                                                                 |
+-----------------------+--------------------------------------------------------------------------------------------------+
(neutron) port-show d3f62ef3-9acc-4573-92dc-d736e75319bf
+-----------------------+--------------------------------------------------------------------------------------------------+
| Field                 | Value                                                                                            |
+-----------------------+--------------------------------------------------------------------------------------------------+
| admin_state_up        | True                                                                                             |
| allowed_address_pairs |                                                                                                  |
| binding:host_id       | neumann                                                                                          |
| binding:profile       | {}                                                                                               |
| binding:vif_details   | {"port_filter": true, "ovs_hybrid_plug": true}                                                   |
| binding:vif_type      | ovs                                                                                              |
| binding:vnic_type     | normal                                                                                           |
| device_id             | dhcpc8cc9efe-d798-57f2-be88-09ee9bf13b89-946bf2b2-a4fe-44c5-8d9e-11fb6cc9fe45                    |
| device_owner          | network:dhcp                                                                                     |
| dns_assignment        | {"hostname": "host-10-0-0-2", "ip_address": "10.0.0.2", "fqdn": "host-10-0-0-2.openstacklocal."} |
| dns_name              |                                                                                                  |
| extra_dhcp_opts       |                                                                                                  |
| fixed_ips             | {"subnet_id": "7a7a1d3a-bd9a-44f6-9c4b-f62b4d7ec33c", "ip_address": "10.0.0.2"}                  |
| id                    | d3f62ef3-9acc-4573-92dc-d736e75319bf                                                             |
| mac_address           | fa:16:3e:a1:b6:1f                                                                                |
| name                  |                                                                                                  |
| network_id            | 946bf2b2-a4fe-44c5-8d9e-11fb6cc9fe45                                                             |
| security_groups       |                                                                                                  |
| status                | ACTIVE                                                                                           |
| tenant_id             | 3d811c47313644faaa6b523129b2f334                                                                 |
+-----------------------+--------------------------------------------------------------------------------------------------+

We can see the router port is DOWN, I don't know why and I have no error in the logs. Have you already encountered this kind of strange behaviour?

Thanks for your help ;)