Learn how to configure a static CentOS eight community tackle from the command line

Each CentOS admin ought to know find out how to configure a static IP tackle utilizing nothing however the terminal.

Learn how to configure a static CentOS eight community tackle from the command line
Each CentOS admin ought to know find out how to configure a static IP tackle utilizing nothing however the terminal.
http://itinformation.net/wp-content/uploads/2019/11/how-to-configure-a-static-centos-8-network-address-from-the-command-line.com

CentOS eight is right here and it is chock full of recent options and enhancements. One function that has not modified all that a lot is the configuration of a static community tackle. Though Ubuntu migrated to the way more user-friendly netplan instrument, CentOS continues to be utilizing the old-school technique. 

In the event you do not occur to know find out how to manually configure a community tackle, switching it from DHCP to static, I’ll present you ways.

SEE: Hiring equipment: Community administrator (TechRepublic Premium)

What You may Want

All you will must make this work is the next:

A working occasion of CentOS 8An accessible IP tackle
A consumer with sudo privileges

Learn how to find the system title

The very first thing we should do is find the system title to be configured. Do that with the command:

ip a

This could reveal the title of your community interface (Determine A).

Determine A

centosipa.jpg

My interface title is enp0s3.

Learn how to backup your configuration file

Subsequent, we will backup the unique configuration file with the command:

sudo mv /and many others/sysconfig/network-scripts/ifcfg-NAME /and many others/sysconfig/network-scripts/ifcfg-NAME.bak

The place NAME is the title of your community interface.

Learn how to create a brand new configuration

Now we create a brand new configuration file with the next command:

sudo nano /and many others/sysconfig/network-scripts/ifcfg-NAME

The place NAME is the title of your community interface.

In that file, paste the next:

TYPE=”Ethernet”
BOOTPROTO=”none”
NAME=”NAME”
IPADDR=”IP_ADDRESS”
NETMASK=”255.255.255.zero”
GATEWY=GATEWAY
DEVICE=”NAME”
ONBOOT=”sure”
PEERDNS=no

The place:

NAME is the title of the community interfaceIP_ADDRESS is the static IP tackle you need to apply to the interface
GATEWAY is the gateway tackle in your community

Save and shut the file.

Restart the community supervisor with the command:

sudo systemctl restart NetworkManager

Your static IP tackle has been utilized

Learn how to configure DNS servers

As a result of we’re utilizing a static IP tackle, we’d additionally need to use static addresses for DNS decision (which is why we added PEERDNS=no to the configuration file). To configure DNS servers, problem the command:

sudo nano /and many others/resolv.conf

In that file, add your static DNS addresses under the final line like so:

nameserver eight.eight.four.four,eight.eight.eight.eight

Save and shut the file.

And that is all there’s to configuring a static IP tackle in CentOS eight. 

http://itinformation.net/wp-content/uploads/2019/11/how-to-configure-a-static-centos-8-network-address-from-the-command-line.com

Open Supply Weekly Publication

You do not need to miss our suggestions, tutorials, and commentary on the Linux OS and open supply purposes.
Delivered Tuesdays

Join at present

Join at present

Additionally see

centoshero.jpgcentoshero.jpg

Picture: CentOS

1 thought on “Learn how to configure a static CentOS eight community tackle from the command line

Leave a Reply

Your email address will not be published. Required fields are marked *