Changing the MTU size for existing networks using OpenStack CLI/API

Knowledge Base

Changing the MTU size for existing networks using OpenStack CLI/API


Icons/System/eye-open Created with Sketch. 64 Views 24.05.2023 Cloud / Network Gateway for Public Cloud

Objective

Jumbo frames are Ethernet frames with more than 1500 bytes of payload. They can carry up to 9000 bytes of payload. Using them minimizes routing processing time. In the case of vRack, this will optimize traffic on it.
But if connectivity from a fully private instance to outside networks (Internet) is done in the network, the MTU has to be set to 1500 bytes of payload.
The MTU size will be the same for all services using IPs in the same network.

This guide explains how to change the MTU size for an existing network using OpenStack CLI/API.

Requirements

Before proceeding, it is recommended that you read these guides:

Instructions

Step 1: Listing networks available in the Public Cloud project

List available networks in the region:

openstack network list

+--------------------------------------+------------+-------------------------------------+
| ID                                   | Name       | Subnets                             |
+--------------------------------------+------------+-------------------------------------+
| 34567890-12ab-cdef-xxxx-xxxxxxxxxxxx | Ext-Net    | zzzzzzzz-yyyy-xxxx-yyyy-xxxxxxxxxxxx|
| ed85c4df-5ba6-48fb-a7d3-xxxxxxxxxxxx | openstack  | 10d5fe8b-0596-4525-a387-xxxxxxxxxxxx|
+--------------------------------------+------------+-------------------------------------+

You can grab the ID of your private network ( Ext-Net is a public network used for public IP addresses and is managed by OVHcloud).

Step 2: Displaying private network parameters

Use the following command to display the private network parameters:

openstack network show ed85c4df-5ba6-48fb-a7d3-xxxxxxxxxxxx
+---------------------------+--------------------------------------+
| Field                     | Value                                |
+---------------------------+--------------------------------------+
| admin_state_up            | UP                                   |
| availability_zone_hints   |                                      |
| availability_zones        | nova                                 |
| created_at                | 2023-01-13T08:45:06Z                 |
| description               |                                      |
| dns_domain                | None                                 |
| id                        | ed85c4df-5ba6-48fb-a7d3-xxxxxxxxxxxx |
| ipv4_address_scope        | None                                 |
| ipv6_address_scope        | None                                 |
| is_default                | None                                 |
| is_vlan_transparent       | None                                 |
| l2_adjacency              | True                                 |
| mtu                       | 9000                                 |
| name                      | openstack                            |
| port_security_enabled     | True                                 |
| project_id                | f6e0b44aa5104f689870xxxxxxxxxxxx     |
| provider:network_type     | vrack                                |
| provider:physical_network | None                                 |
| provider:segmentation_id  | 0                                    |
| qos_policy_id             | None                                 |
| revision_number           | 5                                    |
| router:external           | Internal                             |
| segments                  | None                                 |
| shared                    | False                                |
| status                    | ACTIVE                               |
| subnets                   | 10d5fe8b-0596-4525-a387-xxxxxxxxxxxx |
| tags                      |                                      |
| tenant_id                 | f6e0b44aa5104f689870bxxxxxxxxxxx     |
| updated_at                | 2023-01-13T13:43:27Z                 |
+---------------------------+--------------------------------------+

Step 3: Setting the new MTU size

  • Using the OpenStack CLI:
openstack network set --mtu 1500 <networkid>
  • Using the OpenStack API:
TOKEN=$(openstack token issue -c id -f value)
curl -s -H "X-Auth-Token: $TOKEN" -H "Content-Type: application/json"  -H "Accept: application/json" -X PUT -d '{"network": {"mtu": 1500}}' https://network.compute.<region>.cloud.ovh.net/v2.0/networks/<networkid>
  • Using Terraform

With the resource networking_network_v2 from the OpenStack provider, you can set the value for the MTU attribute.

Step 4: Verifying the changes

Display the private network parameters to verify that the change is applied:

openstack network show <network>

Step 5: Restarting the services

Updating the MTU value for an existing network with instances plugged into it requires a hard reboot of those instances which have a port in this network:

Go further

If you need training or technical assistance to implement our solutions, contact your sales representative or click on this link to get a quote and ask our Professional Services experts for assisting you on your specific use case of your project.

Join our community of users on https://community.ovh.com/en/.

Related articles