Howto NetworkManager

From Vidalinux Wiki
Jump to navigation Jump to search

install NetworkManager

make sure you have network-manager installed:

yum install networkmanager -y

start and enable NetworkManager:

systemctl enable NetworkManager && systemctl start NetworkManager

verify NetworkManager service status:

systemctl status NetworkManager

restart NetworkManager service:

systemctl restart NetworkManager

add address to ethernet

add static ip address to your eth0 interface:

nmcli con add con-name eth0 ipv4.method manual type ethernet ifname eth0 ipv4.address 192.168.75.15/24 ipv4.gateway 192.168.75.1 ipv4.dns 4.2.2.1,4.2.2.2 autoconnect yes

enable network interface eth0:

nmcli con up eth0

if you want to configure dhcp to your eth0 interface use the following command instead:

nmcli con add con-name eth0 ipv4.method auto type ethernet ifname eth0 autoconnect yes

NetworkManager commands

show connections using nmcli:

nmcli con show

show active connections using nmcli:

nmcli con show --active

show more details about connection device:

nmcli con show "System eth0"

delete connection device:

nmcli con del "System eth0"

bring down or deactive network profile using nmcli:

nmcli con up static

bring up or enable network profile using nmcli:

nmcli con up static

reload configuration using nmcli:

nmcli con reload
nmcli con up static

add another ip address to interface eth0 using nmcli

nmcli con modify "static" +ipv4.address "192.168.75.18/24"

replace added ip address on interface eth0 using nmcli:

nmcli con modify "static" -ipv4.address "192.168.75.18/24"

replace current nameservers with 8.8.8.8 using nmcli:

nmcli con modify "static" ipv4.dns 8.8.8.8

create bridge interface

create the bridge interface:

nmcli connection add type bridge autoconnect yes con-name br0 ifname br0

add device to bridge:

nmcli connection add type bridge-slave autoconnect yes con-name br0-eth0 ifname eth0 master br0

add ip address to bridge interface:

nmcli connection modify br0 ipv4.address 192.168.75.15 ipv4.method manual ipv4.gateway 192.168.75.1 ipv4.dns 4.2.2.1,4.2.2.2

active bridge interface:

nmcli connection up br0

create vlan

create vlan interface:

# vlan105
nmcli con add type bridge ifname vlan105 con-name vlan105 connection.autoconnect yes
nmcli con modify vlan105 ipv4.method disabled ipv6.method ignore
nmcli con up vlan105
nmcli con add type vlan con-name eno2np1.105 dev eno2np1 id 105 master vlan105 connection.autoconnect yes
# vlan104
nmcli con add type bridge ifname vlan104 con-name vlan104 connection.autoconnect yes
nmcli con modify vlan104 ipv4.method disabled ipv6.method ignore
nmcli con up vlan104
nmcli con add type vlan con-name eno2np1.104 dev eno2np1 id 104 master vlan104 connection.autoconnect yes

network teaming

add team interface:

nmcli con add type team con-name team0 ifname team0 config '{"runner": {"name": "activebackup"}}'

add ipv4 address to interface:

nmcli con modify team0 ipv4.address 192.168.75.15/24 ipv4.method manual ipv4.gateway 192.168.75.1 ipv4.dns 4.2.2.1,4.2.2.2

add ports to interface:

nmcli con add type team-slave con-name team0-eth0 ifname eth0 master team0
nmcli con add type team-slave con-name team0-eth1 ifname eth1 master team0

start interface team0:

nmcli con up team0

enable interfaces:

nmcli device enable eth0
nmcli device enable eth1

test connection disabling one interface:

nmcli device disconnect eth0