Open vSwitch: Create TunTap Devices

Learn how to create TunTap devices using Open vSwitch on Ubuntu 20.04. Set up bridges, assign static IPs, and configure NAT for internet access.

Author

Faiz Ahmed Farooqui
Faiz Ahmed FarooquiPrincipal Technical Consultant.

Date

Mar 3, 2025

Table of Contents

Open vSwitch (OVS) is a multi-layer software switch designed to enable massive network automation and programmability while providing support for standard management protocols.

Apart from its extensive feature set, one of the key advantages of OVS is its support for networking tunnelling protocols, a use case that is widely employed in software-defined networking (SDN) deployments.

In this regard, we will introduce you to the Tun/Tap network devices, which are a key feature of the Linux kernel and are used for creating network bridges. Specifically, this article will guide you on how to create TunTap devices using an Open vSwitch (OVS) bridge and allocate static IPs to the virtual ports.

Creating TunTap Devices

TunTap devices are software network interfaces provided by the Linux kernel. They can be created and managed just like physical network interfaces.

Create Network Interface

We have two commands above, the first command adds vSwitch0 to the br0 bridge and the second command sets internal type to the vSwitch0 interface.

Add the Physical Network Interface to the Bridge

Traffic will now flow between the physical network interface and the Open vSwitch bridge. Remember to change eno1 with your Physical Network Interface.

Create TunTap device

Attach TunTap to Bridge

You should now have a tap device called vport0 which is part of the br0 OVS bridge.

Allocating Static IP Addresses

Static IP addressing, as opposed to dynamic addressing, is when a device keeps the same IP address every time it connects to the network.

Assign Gateway IP to Bridge's Internal Switch

To assign a Gateway IP address to internal Switch, perform the following steps:

/24 is a netmask.

Assign Static IP to TunTap device

To assign a static IP address to your newly created vport0 interface, perform the following steps:

Remove the current IP from the device (if any):

Now, you can assign a new IP address. The following command will assign IP 172.168.1.100 to vport0:

Up all the Interfaces and TunTaps

These two commands will up all your interfaces. You can verify the same by running ifconfig command.

IP Forwarding & NAT Configuration

IP forwarding is the ability for an operating system to accept incoming network packets on one interface, recognize that it is not meant for the system itself, but that it should be passed on to another network, and then forwards it accordingly.

Make NAT Configuration for Internt Access

You can use a NAT device to allow resources in private subnets to connect to the internet, other VPCs, or on-premises networks. These instances can communicate with services outside the VPC, but they cannot receive unsolicited connection requests.

Traffic will now flow between the physical network interface and the Open vSwitch bridge. Remember to change eno1 with your Physical Network Interface.

Conclusion

This guide has walked you through the process of creating TunTap devices using OVS bridge and assigning static IPs to the virtual ports on Ubuntu 20.04.

With this knowledge, you can effectively set up and manage virtual network interfaces in your environment.

Please remember that, as with all things, practice furthers understanding. So, feel free to experiment with different configurations to fully comprehend the flexible nature of Open vSwitch.

Stay tuned for more insightful articles on advanced networking with Open vSwitch!

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

SHARE ON

Related Articles.

More from the engineering frontline.

Dive deep into our research and insights on design, development, and the impact of various trends to businesses.

How We Built an AI System That Automates Senior Solution Architect Workflows
Article

Apr 6, 2026

How We Built an AI System That Automates Senior Solution Architect Workflows

Discover how we built a 4-agent AI co-pilot that converts complex RFPs into draft technical proposals in 15 minutes — with built-in conflict detection, assumption surfacing, and confidence scoring.

AI Code Healer for Fixing Broken CI/CD Builds Fast
Article

Apr 6, 2026

AI Code Healer for Fixing Broken CI/CD Builds Fast

A deep dive into how GeekyAnts built an AI-powered Code Healer that analyzes CI/CD failures, summarizes logs, and generates code-level fixes to keep development moving.

A Real-Time AI Fraud Decision Engine Under 50ms
Article

Apr 2, 2026

A Real-Time AI Fraud Decision Engine Under 50ms

A deep dive into how GeekyAnts built a real-time AI fraud detection system that evaluates transactions in milliseconds using a hybrid multi-agent approach.

Building an Autonomous Multi-Agent Fraud Detection System in Under 200ms
Article

Apr 1, 2026

Building an Autonomous Multi-Agent Fraud Detection System in Under 200ms

GeekyAnts built a 5-agent fraud detection pipeline that makes decisions in under 200ms — 15x cheaper than single-model systems, with full explainability built in.

Building a Self-Healing CI/CD System with an AI Agent
Article

Mar 31, 2026

Building a Self-Healing CI/CD System with an AI Agent

When code breaks a pipeline, developers have to stop working and figure out why. This blog shows how an AI agent reads the error, finds the fix, and submits it for review all on its own.

Maestro Automation Framework — Advanced to Expert
Article

Mar 26, 2026

Maestro Automation Framework — Advanced to Expert

Master Maestro at scale. Learn architecture, reusable flows, CI/CD optimization, and how to eliminate flakiness in production-grade mobile automation.Master Maestro at scale. Learn architecture, reusable flows, CI/CD optimization, and how to eliminate flakiness in production-grade mobile automation.

Scroll for more
View all articles