Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

Ubuntu 18.04.1 netplan metric priority or Priority Interface with ethernet conecction

$
0
0
how can configure priority in new yaml setup network.

in old version i have this:
Code:

auto lo
iface lo inet loopback
auto new0
iface new0 inet static
    address xxx.xxx.xxx.xxx
    netmask xxx.xxx.xxx.xxx
    up route add default gw aaa.aaa.aaa.aaa metric 10
    down route del default gw aaa.aaa.aaa.aaa

auto new1
iface new1 inet static
    address yyy.yyy.yyy.yyy
    netmask yyy.yyy.yyy.yyy
    up route add default gw bbb.bbb.bbb.bbb
    down route del default gw bbb.bbb.bbb.bbb


but I need to prioritize interface with ethernet connection. because i have two, one working and one on backup connection.
yaml files:

Code:

01-netcfg.yaml
network:
 version: 2
 renderer: networkd
 ethernets:
  epn0s3:
    dhcp4: no
    dhcp6: no
    addresses: [192.168.1.194/24]
    gateway4: 192.168.1.1
    nameservers:
      addresses: [192.168.2.2]

backup
Code:

02-netcfg.yaml
network:
 version: 2
 renderer: networkd
 ethernets:
  epn0s8:
    dhcp4: no
    dhcp6: no
    addresses: [192.168.50.115/24]
    gateway4: 192.168.50.1
    nameservers:
      addresses: [192.168.50.1]

I do not get that if one connection falls, the other automatically goes into operation.
the problem is that i get error: "resolution name" when i try to ping www.google.com after this -> one not automatical solution is, run some command:

Code:

//When this connection is not working
sudo ifconfig enp0s8 down
sudo ifconfig enp0s3 up

//or backward
sudo ifconfig enp0s8 up
sudo ifconfig enp0s3 down

but i think that this need to be automaticaly and not depending of user.

on fail connection or fail name resolution; linux can't walk through all network devices to try get a solution automatically???

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>