Configure GRE via Netplan (headless/aws)

How to translate the below to a Netplan yaml file with networkd as the renderer?

At the command line these commands work and build a GRE tunnel with an MTU of 1476.

ip tunnel add gre1 mode gre remote [x.x.x.x] local [y.y.y.y] ttl 255 ip link set gre1 up ip addr add [z.z.z.z]/30 dev gre1 

Where [x.x.x.x] is the remote GRE endpoint, [y.y.y.y] is the private IP of GRE endpoint and [z.z.z.z] is the address assigned to the local GRE interface.

Tried using the following yaml fragment the tunnel is defined but MTU is ‘ignored’ and the LAN i/f MTU-24 is set.

    tunnels:         gre1:             mode: gre             local: [y.y.y.y]             remote: [x.x.x.x]             mtu: 1476             addresses:                 - [z.z.z.z]/30 

The output from various commands:

# systemctl status systemd-networkd | grep gre1 Sep 16 11:49:40 ip-y-y-y-y systemd-networkd[1283]: gre1: Cannot enable IPv6 for interface gre1: No such file or directory Sep 16 11:49:40 ip-y-y-y-y systemd-networkd[1283]: gre1: Could not bring up interface: Address family not supported by protocol  # ip a 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000     link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00     inet 127.0.0.1/8 scope host lo        valid_lft forever preferred_lft forever     inet6 ::1/128 scope host        valid_lft forever preferred_lft forever 2: ens5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 9001 qdisc mq state UP group default qlen 1000     link/ether 16:74:7e:e0:07:46 brd ff:ff:ff:ff:ff:ff     inet [y.y.y.y]/24 brd [y.y.y.255] scope global dynamic ens5        valid_lft 2631sec preferred_lft 2631sec     inet6 fe80::1474:7eff:fee0:746/64 scope link        valid_lft forever preferred_lft forever 3: gre0@NONE: <NOARP> mtu 1476 qdisc noop state DOWN group default qlen 1000     link/gre 0.0.0.0 brd 0.0.0.0 4: gretap0@NONE: <BROADCAST,MULTICAST> mtu 1462 qdisc noop state DOWN group default qlen 1000     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff 5: erspan0@NONE: <BROADCAST,MULTICAST> mtu 1450 qdisc noop state DOWN group default qlen 1000     link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff 6: gre1@NONE: <POINTOPOINT,NOARP> mtu 8977 qdisc noop state DOWN group default qlen 1000     link/gre [y.y.y.y] peer [x.x.x.x]     inet [z.z.z.z]/30 brd [z.z.z.255] scope global gre1        valid_lft forever preferred_lft forever 

Bridging LAN and WIFI using netplan not working and killing AP

Hello everyone and thanks in advance!

I’m trying to extend my local LAN network via WIFI and would like all devices in the same network. The setup is as follows:

  • DHCP/DNS server running inside the LAN
  • separate PC linked to the LAN, with WIFI capability (sadly it’s not an option, to have the DHCP/DNS server running on this machine)

Since I’m running Ubuntu 18.04, I’m trying to use netplan to set everything up. Here’s my conf file:

network:   version: 2   renderer: NetworkManager   ethernets:     enp2s0:       dhcp4: no       addresses: [192.168.1.10/24]       gateway: 192.168.1.1       nameservers:         addresses: [192.168.1.2, 8.8.8.8, 8.8.4.4]   wifis:     wlp1s0:       access-points:         "MyWifi":           mode: ap           password: "DONTLOOK"   bridges:     br0:       dhcp4: yes       interfaces: [enp2s0, wlp1s0] 

Now, running the two network separately, i.e without the bridges section, everything works. With dnsmasq activated I can connect to the access point.

However I can’t seem to get the bridge working. Even worse is, as soon as the bridge gets activated access to the AP is no longer possible.

Does anybody have an idea, what I’m missing?

Apply last edits in netplan with no service

On my virtual computer I hace two NICs. Internet connection works fine, thanks to network-bridge. Now, I edited my /etc/netplan/01-netcf...yaml. Since I have no network services as network-manager or networking I always have to reboot whole computer, to apply the changes. (I cannot restart any service). Is there any way to avoid restarting whole PC ?

Setting up new ubuntu server through ESXI (netplan not working)

No doubt I am doing something wrong but I am not familiar with ubuntu, not even linux that well.

I have deployed ubuntu server via ESXI on an OVH Dedicated server.

I’ve done this a million times with windows machines but it is a alot easier on there…

img: this is what the settings would be on windows

How would I format this on netplan now?

How to use netplan to create two seperate routing tables?

I have an Ubuntu 18.04 host with two network interfaces on two subnets. I would like to set up symmetric routing so that traffic received from one interface is sent symmetrically out that same interface.

I know how to use Netplan for simple network configurations, but I’m stumped for more advanced configurations. Specifically:

  1. What is the Netplan syntax to add a default route like I do with ip route add default via 192.168.0.1 dev ens192 tab 1?
  2. How can I add a priority tag to a route?

My server has two IPs:

$   ip a|grep "inet " inet 127.0.0.1/8 scope host lo inet 192.168.0.10/22 brd 192.168.0.255 scope global ens192 inet 192.168.1.10/24 brd 192.168.1.255 scope global ens224 $   

I can use the following ip rules to get the tables that I want:

First, I create a route for each network and then add a default gateway.

$   ip route add 192.168.0.0/24 dev ens192 tab 1 $   ip route add 192.168.1.0/24 dev ens224 tab 2 $   ip route add default via 192.168.0.1 dev ens192 tab 1 $   ip route add default via 192.168.1.1 dev ens224 tab 2 

Then, I can create corresponding rules:

$   ip rule add from 192.168.0.10/32 tab 1 priority 100 $   ip rule add from 192.168.1.10/32 tab 2 priority 200 $   ip route flush cache 

This gets the routes that I want:

$   ip route show tab 1 default via 192.168.0.1 dev ens192 $   ip route show tab 2 default via 192.168.1.1 dev ens224 $   ip route default via 192.168.0.10 dev ens192 

As well as the rules that I want:

$   ip rule show 0:      from all lookup local 100:    from 192.168.0.10 lookup 1 200:    from 192.168.1.10 lookup 2 32766:  from all lookup main 32767:  from all lookup default 

Define hostapd configuration settings on netplan

I recently discovered that netplan can manage hostapd accesspoints, but this is the extent of the example config:

    wlp1s0:       access-points:         "guest":            mode: ap            # no WPA config implies default of open 

I can find no other documentations of how to define other settings like WPA security and passphrase. I need the following hostapd.conf settings defined and EAP in the future as well:

interface=wlo1 bridge=br0 hw_mode=g channel=0 ieee80211d=1 country_code=AE ieee80211n=1 wmm_enabled=1  ssid=SSID auth_algs=1 wpa=2 wpa_key_mgmt=WPA-PSK  rsn_pairwise=CCMP wpa_passphrase=********* 

I am aware netplan requires NetworkManager for access point configuration, and I don’t know if keeping the bridge managed by networkd will hinder the bridging. If possible, please clarify this point as well.

Got error when added a static route in netplan config file

My 50-cloud-init.yaml just like below.

network:     ethernets:         eth1:             addresses: [192.168.0.100/24]         routes:           - to: 192.168.1.100/32             via: 192.168.0.1             metric: 100     version: 2 

And I saved it and executed sudo netplan apply, then I got this error:

/etc/netplan/50-cloud-init.yaml:21:11: Error in network definition: expected mapping (check indentation)           - to: 192.168.1.100/32           ^ 

How can I fix it?
Thank you guys!

Netplan issue, cannot do a ip static

i try to set a two interfaces for my server, ubuntu server 18.04, I share internet in a lan Here is the configuration

File 01-netcfg.yaml

 network:      version: 2      renderer: networkd      ethernets:          enp4s0:              dhcp4: true 

and the 02-netcfg.yaml

 network:      version: 2      renderer: networkd      ethernets:          enp3s0:              addresses: [192.168.1.1/24, ]              dhcp4: false              dhcp6: false              nameservers:                  addresses: [192.168.1.1, 8.8.8.8] 

ifconfig returns

enp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500         ether 14:cc:20:02:9e:fe  txqueuelen 1000  (Ethernet)         RX packets 0  bytes 0 (0.0 B)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 0  bytes 0 (0.0 B)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  enp4s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500         inet 192.168.0.12  netmask 255.255.255.0  broadcast 192.168.0.255         inet6 fe80::e23f:49ff:fe52:22be  prefixlen 64  scopeid 0x20<link>         ether e0:3f:49:52:22:be  txqueuelen 1000  (Ethernet)         RX packets 3154  bytes 479397 (479.3 KB)         RX errors 0  dropped 48  overruns 0  frame 0         TX packets 199  bytes 28954 (28.9 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0  lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536         inet 127.0.0.1  netmask 255.0.0.0         inet6 ::1  prefixlen 128  scopeid 0x10<host>         loop  txqueuelen 1000  (Local Loopback)         RX packets 308  bytes 21480 (21.4 KB)         RX errors 0  dropped 0  overruns 0  frame 0         TX packets 308  bytes 21480 (21.4 KB)         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0 

Here is netplan apply command

netplan --debug apply ** (generate:2734): DEBUG: 14:28:02.178: Processing input file /etc/netplan/01-netcfg.yaml.. ** (generate:2734): DEBUG: 14:28:02.178: starting new processing pass ** (generate:2734): DEBUG: 14:28:02.179: Processing input file /etc/netplan/02-netcfg.yaml.. ** (generate:2734): DEBUG: 14:28:02.179: starting new processing pass ** (generate:2734): DEBUG: 14:28:02.179: enp3s0: setting default backend to 1 ** (generate:2734): DEBUG: 14:28:02.179: Configuration is valid ** (generate:2734): DEBUG: 14:28:02.179: enp4s0: setting default backend to 1 ** (generate:2734): DEBUG: 14:28:02.179: Configuration is valid ** (generate:2734): DEBUG: 14:28:02.179: Generating output files.. ** (generate:2734): DEBUG: 14:28:02.179: NetworkManager: definition enp4s0 is not for us (backend 1) ** (generate:2734): DEBUG: 14:28:02.179: NetworkManager: definition enp3s0 is not for us (backend 1) DEBUG:netplan generated networkd configuration changed, restarting networkd DEBUG:no netplan generated NM configuration exists DEBUG:enp4s0 not found in {} DEBUG:enp3s0 not found in {'enp4s0': {'dhcp4': True}} DEBUG:Merged config: network:   bonds: {}   bridges: {}   ethernets:     enp3s0:       addresses:       - 192.168.1.1/24       dhcp4: false       dhcp6: false       nameservers:         addresses:         - 192.168.1.1         - 8.8.8.8     enp4s0:       dhcp4: true   vlans: {}   wifis: {}  DEBUG:Skipping non-physical interface: lo DEBUG:device enp4s0 operstate is up, not changing DEBUG:Skipping non-physical interface: tap0 DEBUG:{} DEBUG:netplan triggering .link rules for lo DEBUG:netplan triggering .link rules for enp3s0 DEBUG:netplan triggering .link rules for enp4s0 DEBUG:netplan triggering .link rules for tap0 

I don’t know why i cannot set ip address, please anyone can help me?

Need help with netplan configuration

Kindly asking for help to port the following network config to netplan:

ip route add default via 127.0.0.1 dev lo table mytable ip rule add from all fwmark 10 lookup mytable  > cat /etc/netplan/01-netcfg.yaml  # This file describes the network interfaces available on your system # For more information, see netplan(5). network:   version: 2   renderer: networkd   ethernets:     ens192:       dhcp4: yes 

Apologies if that’s a silly question – I’m new to netplan and networking in general.