✓ Solved

How do I configure Netplan (OpenVPN - VLan)

I have two servers (both Ubuntu 20.4)

Server A has a public address on eth0 and is an OpenVPN server. clients connect through tun0 with address. Server A also has a VLAN address on eth1.

Server B has a public address (only used for SSH) and on Eth1 has a VLAN address. When I add "ip route add via" my VPN clients can access Server B resources.

I want to make this a persistent route. Support has provided me the below docs. If I understand correctly I need to (On Server B):

  1. Disable network helper.
  2. Remove default configuration files that may interfere with static addressing:

sudo rm /etc/systemd/network/05-eth0.network
sudo rm /etc/netplan/01-netcfg.yaml

  1. Create the configuration file for Netplan:

File: /etc/netplan/01-eth0.yaml

ISSUE: I'm not sure how to construct the configuration file. The example in the support doc only shows eth0 and does not show the added route (ip route add via I'm not sure if DHCP be disabled on both interfaces eth0 and eth1?

Does any one have a sample configuration file that could help me understand?


Linode Support provided links

3 Replies

✓ Best Answer

I'm not sure if DHCP be disabled on both interfaces eth0 and eth1?

In this example we are going to be configuring static routes, so let's keep the configuration static to avoid confusion.

In your example, Server A is acting as the OpenVPN server will be responsible for:

  • routing between the Linode vLAN (, the OpenVPN client network (,) and the default route (
  • configuring the clients on the network to have a route to via

The above network configuration needs to be handled via the OpenVPN software setup. This leaves us to configure Server B which will need to know how to reach the OpenVPN client network ( via

Let me extend the example provided in https://www.linode.com/docs/guides/linux-static-ip-configuration/

The guide mentions removing 05-eth0.network, but adding a VLAN also created a 05-eth1.network file as well, we will want to remove that too.

/etc/netplan/01-eth0.yaml Shown verbatim from the guide. Addresses need to be changed to match your configuration

# This file describes the network interfaces available on your system
# For more information, see netplan(5).
  version: 2
  renderer: networkd
      dhcp4: no
      dhcp6: no
        -                         # Your Linode's public IPv4 address.
        -                          # Private IPv4 address.
        - "2001:db8:2000:aff0::2/64"              # Primary IPv6 SLAAC address.
      gateway4:                      # Primary IPv4 gateway.
      gateway6: "fe80::1"                         # Primary IPv6 gateway.
        search: [203-0-113-0.ip.linodeusercontent.com]              # Search domain.
        addresses: [,]    # DNS Server IP addresses.

Let's create another file for the extra interface:


  version: 2
  renderer: networkd
      dhcp4: no
      dhcp6: no
        - to:

You will want to run netplan apply and then verify that your interfaces are correct with ip a and that your routes are rendered correctly with ip r.

Thank you for the help. Routing works great!

I'm not sure about where to find what to put for this DNS entry in /etc/netplan/01-eth0.yaml .

search: [203-0-113-0.ip.linodeusercontent.com] # Search domain.

Any thoughts?

Can i know why you or your team no help me ?!


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct