Skip to content

Instantly share code, notes, and snippets.

@brunneis
Last active July 23, 2019 20:58
Show Gist options
  • Save brunneis/122ef79bd951a0b9d7df5a37361827f1 to your computer and use it in GitHub Desktop.
Save brunneis/122ef79bd951a0b9d7df5a37361827f1 to your computer and use it in GitHub Desktop.
Fedora 30+ static networking / CentOS 7+

Show the available interfaces:

nmcli device

Edit the interface configuration file

/etc/sysconfig/network-scripts/eth0

Configure the interface with the NetworkManager so it autoconnects

nmcli connection modify eth0 connection.autoconnect true

Modify the properties as shown below:

  • Change BOOTPROTO value from dhcp to none
  • Set the properties IPADDR, PREFIX/NETMASK, GATEWAY and DNS1, DNS2
  • Ensure the property ONBOOT is set to yes

Reset the connection:

nmcli connection down eth0
nmcli connection up eth0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment