Debian 12 bookworm
Sponsored Link

OpenStack Zed : Configure Neutron Network2023/06/27

 
Configure Networking for Virtual Machine Instances.
For example, configure FLAT type of networking on here.
The Node has 2 network interfaces like follows.
        eth0|10.0.0.30 
+-----------+-----------+
|   [ dlp.srv.world ]   |
|     (Control Node)    |
|                       |
|  MariaDB    RabbitMQ  |
|  Memcached  Nginx     |
|  Keystone   httpd     |
|  Glance     Nova API  |
|  Nova Compute         |
|    Neutron Server     |
|   Neutron Metadata    |
|  Neutron L2/L3 Agent  |
|    Open vSwitch       |
+-----------+-----------+
        eth1|(UP with no IP)

[1] Configure Neutron services.
root@dlp ~(keystone)#
vi /etc/network/interfaces
# add to the end : setting for anonymous interface
# replace the name [eth1] to your environment

auto eth1
iface eth1 inet manual

root@dlp ~(keystone)#
ip link set eth1 up

# add bridge (any name you like for [br-eth1])

root@dlp ~(keystone)#
ovs-vsctl add-br br-eth1

root@dlp ~(keystone)#
ip link set br-eth1 up

root@dlp ~(keystone)#
echo -e '\nauto br-eth1\niface br-eth1 inet manual' >> /etc/network/interfaces
# add a port to the bridge
# replace [eth1] to your own environment

root@dlp ~(keystone)#
ovs-vsctl add-port br-eth1 eth1
root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/ml2_conf.ini
# add a line under [ml2_type_flat] section

[ml2_type_flat]
flat_networks = physnet1
root@dlp ~(keystone)#
vi /etc/neutron/plugins/ml2/openvswitch_agent.ini
# add a line undet [ovs] section

[ovs]
bridge_mappings = physnet1:br-eth1
root@dlp ~(keystone)#
systemctl restart neutron-api neutron-rpc-server neutron-openvswitch-agent
[2] Create virtual network.
root@dlp ~(keystone)#
projectID=$(openstack project list | grep service | awk '{print $2}')
# create network named [sharednet1]

root@dlp ~(keystone)#
openstack network create --project $projectID \
--share --provider-network-type flat --provider-physical-network physnet1 sharednet1

+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        |                                      |
| created_at                | 2023-06-27T02:37:06Z                 |
| description               |                                      |
| dns_domain                | None                                 |
| id                        | 69962e3a-3e00-41b8-866b-d67cc50b11b9 |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| is_default                | False                                |
| is_vlan_transparent       | None                                 |
| mtu                       | 1500                                 |
| name                      | sharednet1                           |
| port_security_enabled     | True                                 |
| project_id                | d8b09d86ed7743039f92b2e542ea26c1     |
| provider:network_type     | flat                                 |
| provider:physical_network | physnet1                             |
| provider:segmentation_id  | None                                 |
| qos_policy_id             | None                                 |
| revision_number           | 1                                    |
| router:external           | Internal                             |
| segments                  | None                                 |
| shared                    | True                                 |
| status                    | ACTIVE                               |
| subnets                   |                                      |
| tags                      |                                      |
| updated_at                | 2023-06-27T02:37:06Z                 |
+---------------------------+--------------------------------------+

# create subnet [10.0.0.0/24] in [sharednet1]

root@dlp ~(keystone)#
openstack subnet create subnet1 --network sharednet1 \
--project $projectID --subnet-range 10.0.0.0/24 \
--allocation-pool start=10.0.0.200,end=10.0.0.254 \
--gateway 10.0.0.1 --dns-nameserver 10.0.0.10

+----------------------+--------------------------------------+
| Field                | Value                                |
+----------------------+--------------------------------------+
| allocation_pools     | 10.0.0.200-10.0.0.254                |
| cidr                 | 10.0.0.0/24                          |
| created_at           | 2023-06-27T02:37:36Z                 |
| description          |                                      |
| dns_nameservers      | 10.0.0.10                            |
| dns_publish_fixed_ip | None                                 |
| enable_dhcp          | True                                 |
| gateway_ip           | 10.0.0.1                             |
| host_routes          |                                      |
| id                   | 2af9e60c-505e-439d-80af-61636d4266ca |
| ip_version           | 4                                    |
| ipv6_address_mode    | None                                 |
| ipv6_ra_mode         | None                                 |
| name                 | subnet1                              |
| network_id           | 69962e3a-3e00-41b8-866b-d67cc50b11b9 |
| project_id           | d8b09d86ed7743039f92b2e542ea26c1     |
| revision_number      | 0                                    |
| segment_id           | None                                 |
| service_types        |                                      |
| subnetpool_id        | None                                 |
| tags                 |                                      |
| updated_at           | 2023-06-27T02:37:36Z                 |
+----------------------+--------------------------------------+

# confirm settings

root@dlp ~(keystone)#
openstack network list

+--------------------------------------+------------+--------------------------------------+
| ID                                   | Name       | Subnets                              |
+--------------------------------------+------------+--------------------------------------+
| 69962e3a-3e00-41b8-866b-d67cc50b11b9 | sharednet1 | 2af9e60c-505e-439d-80af-61636d4266ca |
+--------------------------------------+------------+--------------------------------------+

root@dlp ~(keystone)#
openstack subnet list

+--------------------------------------+---------+--------------------------------------+-------------+
| ID                                   | Name    | Network                              | Subnet      |
+--------------------------------------+---------+--------------------------------------+-------------+
| 2af9e60c-505e-439d-80af-61636d4266ca | subnet1 | 69962e3a-3e00-41b8-866b-d67cc50b11b9 | 10.0.0.0/24 |
+--------------------------------------+---------+--------------------------------------+-------------+
Matched Content