Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 12902  / 1 Year ago, sat, april 8, 2023, 6:35:19

I'm using Ubuntu 18.04 bionic.


when I try to configure GRE Tunnel in the netcfg.yaml file I encounter an error:


Error in network definition //etc/netplan/01-netcfg.yaml line x column x: unknown key tunnels.


The yaml configuration looks like this:


Yaml configuration screenshot


network:
version: 2
renderer: networkd
ethernets:
ens01:
addresses : [10.201.x.yyy/24]
gateway4: 10.201.x.254
nameservers:
addresses: [10.200.nn.tt]
dhcp4: no
ens02:
dhcp4: no
addresses : [10.200.aa.dd/24]
routes:
- to: 10.200.hh.0/24
via: 10.200.aa.254

tunnels:
gre1:
mode: gre
local: 10.200.aa.dd
remote: 10.200.hh.cc
addresses:
- 172.26.jj.14/32
gateway4: 172.26.jj.13

What is the right way to configure GRE Tunnel on Ubuntu?


A similar yaml configuration, but I still got the same error:


Yaml configuration-2 screenshot


The error is: Error in network definition line 3 column 2: unknown key tunnels


The netplan version is:


Netplan version


More From » 18.04

 Answers
7

The correct .yaml needs to look EXACTLY like this... exact spacing, indentation, no trailing spaces, and no tabs... suggest copy/paste, then edit addresses... (redacting the addresses is unnecessary and creates errors)...


network:
version: 2
renderer: networkd
ethernets:
ens01:
addresses: [10.201.x.yyy/24]
gateway4: 10.201.x.254
nameservers:
addresses: [10.200.nn.tt]
optional: true
ens02:
addresses: [10.200.aa.dd/24]
routes:
- to: 10.200.hh.0/24
via: 10.200.aa.254
optional: true
tunnels:
gre1:
mode: gre
local: 10.200.aa.dd
remote: 10.200.hh.cc
addresses:
- 172.26.jj.14/32
gateway4: 172.26.jj.13

sudo netplan generate


sudo netplan apply


reboot


Update #1:


You have a very old version of netplan installed, and it may not support tunnels. Update netplan, or update your OS.


[#1683] Saturday, April 8, 2023, 1 Year  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jectedrin

Total Points: 491
Total Questions: 105
Total Answers: 111

Location: Netherlands
Member since Mon, Jun 7, 2021
3 Years ago
;