Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save malkab/059b32205cb88cbcb8c5d2207ebffc20 to your computer and use it in GitHub Desktop.
Save malkab/059b32205cb88cbcb8c5d2207ebffc20 to your computer and use it in GitHub Desktop.
Ubuntu Network Manager & Manual Network Configuration

Ubuntu Network Manager & Manual Network Configuration

In case the Network Manager needs to be disabled and the network manually configured, follow this procedures.

Drop the Network Manager:

service network-manager stop

Configure manually the network interface in the /etc/network/interfaces file:

auto lo
iface lo inet loopback

auto enp0s31f6
iface enp0s31f6 inet static
address 192.168.1.54
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
dns-nameservers 8.8.8.8 8.8.4.4 150.214.5.83 150.214.4.35
gateway 192.168.1.1

DNS are configured in /etc/resolv.conf. This file is managed by the Network Manager and is a symlink. Rename the symlink to resolv.conf.back and create a new resolv.conf:

nameserver 8.8.8.8
nameserver 8.8.4.4

Connectivity problems after using Forticlient are resolved often by checking a malformed resolv.conf by Forticlient.

Activate the network interface:

apt-get install ifupdown

/etc/init.d/networking restart

ifup enp0s31f6

Dropping the Manual Network Set Up and Restoring the Network Manager

First, rename again the symlink /etc/resolv.conf (keep the static one).

Deactivate the network interface:

ifdown enp0s31f6

Edit the /etc/netplan/*.yaml to configure a profile for the Network Manager:

network:
  version: 2
  renderer: NetworkManager
  ethernets:
    enp0s31f6:
      dhcp4: no
      addresses:
        - 192.168.1.54/24
      gateway4: 192.168.1.1
      nameservers:
        addresses: [8.8.8.8, 8.8.4.4, 150.214.5.83, 150.214.4.35]

rename the /etc/network/interfaces to /etc/network/interfaces-back, restart the Network Manager and enable the above configuration, and reboot at some point, maybe:

mv /etc/network/interfaces /etc/network/interfaces-back

service network-manager start

netplan apply

/etc/init.d/networking restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment