Open vSwitch Configure: A Step-by-Step Guide

Mar 3, 2025

Open vSwitch Configure: A Step-by-Step Guide

Meta Description: Learn how to configure Open vSwitch on Ubuntu 20.04 with this step-by-step guide. Start, stop, restart, check status, and enable protocols with ease.

Understanding the vast array of features and capabilities that Open vSwitch (OVS) offers is only half the battle; properly implementing them in your network architecture is the other. The previous article served as a guide to installing OVS. Building on that, this guide will demonstrate how to initialize and utilize Open vSwitch on Ubuntu 20.04 using ovs-ctl.

OVS-ctl is a controller program that is designed to manage Open vSwitch daemons. It works by internally calling system startup scripts and should not typically be invoked directly by system administrators.

Initialization and Usage Steps

Start Open vSwitch

The simplest way to start OVS in Ubuntu 20.04 is to run the following command:

ovs-ctl --system-id=random start

This command starts Open vSwitch and performs several tasks such as loading the Open vSwitch kernel module, creating a new database file if it doesn't exist, starts ovsdb-server if it's not already running and initializes some values in the database.

Stop Open vSwitch

OVS can be easily stopped in Ubuntu by running the following command:

ovs-ctl stop

This command stops the ovs-vswitchd and ovsdb-server daemons, but it does not unload the Open vSwitch kernel modules. If the OVS daemons arenโ€™t running, this command will simply do nothing and complete successfully.

Restart Open vSwitch

The restart command is used to perform a stop followed by a start command. This can be performed using the following command:

ovs-ctl --system-id=random restart

This command also has the benefit of saving and restoring OpenFlow flows for each individual bridge.

Check Open vSwitch Status

If you want to verify whether the Open vSwitch daemons ovs-vswitchd and ovsdb-server are running, you can use the status command as follows:

ovs-ctl status

This command prints messages that inform you of the daemons' statuses.

Check Open vSwitch Version

You can confirm the version of your Open vSwitch by running:

ovs-ctl version

This command runs ovsdb-server --version and ovs-vswitchd --version and displays the results.

Enable a Protocol

If you want to enable a protocol in the system iptable configuration, enable-protocol command can be used. This command checks for rules related to a specified protocol in the systemโ€™s iptables configuration. If there are no rules specifically related to that protocol, then it inserts a rule to accept the specified protocol:

ovs-ctl --protocol=<protocol> enable-protocol

Replace <protocol> with the name of the IP protocol to be enabled. If no protocol is explicitly stated, the command defaults to enabling the gre protocol.

Conclusion

Open vSwitch is a crucial part of modern networking, offering a robust and feature-rich platform for network virtualization. With the above basic commands, you can control the Open vSwitch service on your Ubuntu 20.04 and manage your virtual networking configuration effectively.

Remember that practice makes perfect. As you spend more time with OVS, you will become more comfortable navigating its many features and capabilities. Stay tuned for more in-depth articles detailing advanced Open vSwitch operations and potential use cases. Happy networking!

Source: This blog is authored by Faiz Ahmed, Principal Technical Consultant at GeekyAnts. Originally published on Hashnode: Read here.

Subscribe to Our Newsletter

More from the engineering frontline.

Dive deep into our research and insights on design, development, and the impact of various trends to businesses.
Insight
From Test Failure to Root Cause: Building an AI-Assisted Playwright Failure Analysis Pipeline
Oct 9, 2026

From Test Failure to Root Cause: Building an AI-Assisted Playwright Failure Analysis Pipeline

This blog explains how an AI-assisted Playwright pipeline can analyze test failure evidence, identify probable root causes, and support human-validated debugging.

Insight
The Model Context Protocol: From First Call to Production
Oct 8, 2026

The Model Context Protocol: From First Call to Production

This blog explains how Model Context Protocol (MCP) works, from tool discovery and execution to OAuth authorization, security controls, and production deployment.

Insight
Stop Automating Everything: A Balanced Quality Engineering Approach to Testing
Oct 8, 2026

Stop Automating Everything: A Balanced Quality Engineering Approach to Testing

Balanced quality engineering places automation, API testing, exploratory work, and AI where each gives the most value, so teams ship faster without trading away user-perceived quality.

Insight
From Rolling Deployments to Zero-Downtime Releases
Oct 6, 2026

From Rolling Deployments to Zero-Downtime Releases

This blog explains how Blue-Green deployment helps reduce downtime in online banking releases through traffic switching, pod readiness, static-resource versioning, and rapid rollback.

Insight
The Deprecation Notice Nobody Reads
Oct 5, 2026

The Deprecation Notice Nobody Reads

This blog explains why API deprecation notices often fail and how staged retirement, telemetry, brownouts, and scheduled enforcement can make API migrations more controlled and predictable.

Insight
Why Legacy Systems Make Business Growth More Expensive: Navigate A Smarter Path to Legacy Modernization
Sep 23, 2026

Why Legacy Systems Make Business Growth More Expensive: Navigate A Smarter Path to Legacy Modernization

Learn how legacy systems make business growth more expensive and how edge-first modernization can remove constraints without replacing the existing system.

Insight
SSO, Audit Logs and RBAC: The Enterprise Features AI Prototyping Tools Do Not Cover | Sarika Gautam
Sep 23, 2026

SSO, Audit Logs and RBAC: The Enterprise Features AI Prototyping Tools Do Not Cover | Sarika Gautam

Why AI-generated prototypes fail enterprise review: the context behind SSO, the cost of skipping audit logs, and how role explosion makes RBAC a product of its own.

Footer

The Right Conversation Can

Save You Six Months.

Book a Call