Skip to main content

Network Managers

====================================================================================

Ubuntu - Netplan

Before making changes to the network configuration on an Ubuntu machine, ensure that Cloud-init isn't enabled. Cloud-init is essentially Canonicals attempt at having Ubuntu servers fully configure themselves, in terms of networking, Cloud-init will force an Ubuntu machine to attempt to automatically configure it's networking

 

Netplan uses .yaml files for network configuration, these are stored in /etc/netplan

Check DHCP IP leases info

netplan ip leases interfacename

Changes to interfaces are made in the .yaml files, once changes have been made they need to be applied.

To test changes, use the try command. This essentially implements the change for a set amount of time, after which the change is reverted.

netplan try

You can also set a custom timeout time using the below command:

netplan try --timeout=15

To permanently apply a change, use the below command:

netplan apply


====================================================================================

RHEL - nmcli

Network configuration files are stored in /etc/syconfig/network-scripts. Files stored within this directory shouldn't really be edited - these are used for functionality of the ifconfig command, rather than being the interface configuration itself.

Viewing network configuration

View interface connections

nmcli connection show

View interface device status

nmcli device status

View network device configuration

nmcli device show devicename

Editing network settings & configuration

Edit connection settings
nmcli connection edit connectionname

From here, you can edit any of the settings shown in the 'nmcli device show devicename' command

As an example, the below could be used to change the default gateway IP

set ipv4.gateway 10.0.0.2

You would then want to save changes, you're given the option to trial the change or save it permanently

save persistent

or

save temporary

The above uses the nmcli cli to make changes, you can also format commands as below to make changes without entering the dedicated cli:

Add an additional IP to a connection

nmcli connection modify connectionname ipv4.addresses oldIP, newIP
Delete a connection
nmcli connection delete connectionname

Once changes have been made via nmcli, the interface will need restarting

nmcli connection down

nmcli connection up

or

nmcli connection reload

====================================================================================

OpenSUSE - Wicked

Network configuration files are stored in /etc/sysconfig/networks

systemctl status network

Show all interfaces

wicked show all

Show info for specific interface

wicked show eth1

Take interface down or up

wicked ifdown eth1

wicked ifup eth1