1

I deployed openstack via openstack-ansible and I'm trying to set up an openstack network so that the instances are accessible from the physical network (192.168.10.0/20):

openstack network create --share --external \
--provider-physical-network flat \
--provider-network-type flat public

openstack subnet create --network public \
--allocation-pool start=192.168.14.241,end=192.168.14.249 \
--dns-nameserver 192.168.10.144 --gateway 192.168.10.1 \
--subnet-range 192.168.10.0/20 public-subnet

but instances do not receive ip addresses and do not ping anything.

This is my ml2_conf.ini:

cat /etc/neutron/plugins/ml2/ml2_conf.ini
[ml2]
type_drivers = flat,vlan,vxlan,local
tenant_network_types = vxlan,flat,vlan
mechanism_drivers = linuxbridge
extension_drivers = port_security
# ML2 flat networks

[ml2_type_flat]
flat_networks = flat
# ML2 VLAN networks

[ml2_type_vlan]
network_vlan_ranges = vlan:101:200,vlan:301:400
# ML2 VXLAN networks

[ml2_type_vxlan]
vxlan_group = 239.1.1.1
vni_ranges = 1:1000

[ml2_type_geneve]
vni_ranges =
max_header_size = 38
# Security groups

[securitygroup]
enable_security_group = True
enable_ipset = True

Have any ideas how to fix this?

Alex G
  • 15
  • 3
  • Does your flat network serve DHCP? Usually, with flat networks you need to provide the ip configuration differently, e.g. via config-drive. So it may not be your neutron config but just a missing step to configure the instance's IPs and gateway. – eblock Dec 22 '21 at 08:46

1 Answers1

1
  • 1, check whether the network:dhcp port exist or not, it should exist and show that there is one or more ports which has the ip at the head of the range within start=192.168.14.241,end=192.168.14.249. Like this:
# openstack port list --device-owner network:dhcp
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------+--------+
| ID                                   | Name | MAC Address       | Fixed IP Addresses                                                         | Status |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------+--------+
| 08db769d-7500-41c0-bc3a-086fdb75c65d |      | fa:16:3e:4f:76:75 | ip_address='192.168.1.2', subnet_id='83e0dea2-cee3-437b-94c7-d5650d94d921' | ACTIVE |
+--------------------------------------+------+-------------------+----------------------------------------------------------------------------+--------+

  • 2, check there is generate the bridge correctly (brqf775913d-8f consist with the head of the Network's ID, and there is some tapXXX for port which should attach to the instance), like this:
# openstack subnet list
+--------------------------------------+-----------+--------------------------------------+----------------+
| ID                                   | Name      | Network                              | Subnet         |
+--------------------------------------+-----------+--------------------------------------+----------------+
| 83e0dea2-cee3-437b-94c7-d5650d94d921 | flat_snet | f775913d-8f9d-4f46-9fe7-2a1bce710ec6 | 192.168.1.0/24 |
+--------------------------------------+-----------+--------------------------------------+----------------+

# brctl show
bridge name bridge id       STP enabled interfaces
brqf775913d-8f      8000.000ec6ade4f2   no      enx000ec6ade4f2
                            tap08db769d-75
                            tapd4d2a5e3-fd
docker0     8000.0242e6da798c   no
  • 3, check the instance has configured with the correct ip info (ip a and ip r s or others to check the network traffic like traceroute) by login the instance console.

  • 4, in my situation, we should set the pvid's value as the only one flat network's vlanID in the switch ports which connect to the hypervisors, because we have other vlan networks which configured as vlan type in openstack cluster.

Victor Lee
  • 2,467
  • 3
  • 19
  • 37
  • 1
    VictorLee, thanks for your answer! It really helped, here's what I did: 1) Enabled DHCP in the subnet settings (while the allocation-pool left the same) 2) Added a physical network interface to the bridge with a name like the network id – Alex G Dec 24 '21 at 10:32
  • @AlexG My pleasure, but one thing I can't understand why should you add a physical network interface by manual? In my practical, it would auto generate the `brctl show`'s result while I configure with `network_interface: "enp3s0";neutron_external_interface: "enx000ec6ade4f2"` in **/etc/kolla/globals.yml**. Could you **restart `neutron-server`** (use caution) and generate the new interfaces automatically? Or maybe you need to add the interfaces by manual after the service or hypervisor reboot. – Victor Lee Dec 25 '21 at 01:50