Frequently Asked Question

Setup Network
Last Updated a year ago

RHEL / CentOS - How to setup the Network Manually

Without NetworkManager and using Traditional Configuration Files

Firstly, let's figure out what our adapter is

  1. ls -la /sys/class/net

This will give device names for the physical adapters

  1. ip link

should confirm it and provide a mac address. For this tutorial I'm going to assume its 00:0c:29:e1:b2:7c

We next need to disable Network Manager (if its enabled)

  1. systemctl stop NetworkManager
  2. systemctl disable NetworkManager

Now we need to create the device config file in /etc/sysconfig/network-scripts using the physical device name above. I'm going to assume for this tutorial that it was called eno160.

create a file /etc/sysconfig/network-scripts/ifcfg-ens160

NM_CONTROLLED="no"
HWADDR="00:0c:29:e1:b2:7c"
TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="no"
DEVICE="eno160"
ONBOOT="yes"

Then we add our local IP stuff to the end e.g.

DNS1="10.1.1.5"
IPADDR="10.1.1.2"
PREFIX="22"
GATEWAY="10.1.1.3"
ZONE=internal

And that's it, now reboot and the interface should come right up.

Powered by GEN UK CLEAN GREEN ENERGY

Loading ...