Digital Marketing

Add Permanent Routes in Linux Using nmcli command line tool

You can use the following command to list configured network connections:

nmcli connection show

Example:

$ sudo nmcli connection show | awk '{ print $1,$3,$4}'
NAME TYPE DEVICE
bond0 bond bond0
eno1 ethernet eno1
eno2 ethernet eno2
eno3 ethernet eno3
eno4 ethernet eno4

Then
nmcli connection modify "connection-name" +ipv4.routes "network address/prefix gateway"
nmcli connection reload
nmcli connection up "connection-name"

Example:
sudo nmcli connection modify bond0 +ipv4.routes '172.16.0.0/12 192.168.0.1'
sudo nmcli connection reload
sudo nmcli connection up bond0

Comments

Popular posts from this blog

Fixed WSL sshd: no hostkeys available -- exiting

PowerMTA pmta command

How to fix: mv: failed to preserve ownership