TechRepublic

Account information.

how to assign static ip on centos 7

Share with Your Friends

How to configure a static IP address in CentOS 7

Your email has been sent

Image of Jack Wallen

You may have set up a CentOS server and, in the process, accidentally set it up with DHCP. If your CentOS server uses a GUI, changing that IP address from dynamic to static is very simple. But what if your server is a text-only machine? What do you do then? Fortunately, it’s not all that hard to configure that GUI-less server with a static IP address–you just have to know where it’s configured and know the syntax of the configuration. Of course, by nature of what we’re working on this is all done manually, so be prepared to type.

I’ll be working on CentOS 7 . I’ll assume you already have the operating system installed and working properly, have access to the machine, and have an administrative account. With that out of the way, let’s set up that static IP address.

Find your interface

The first thing we must do is find out the name of our ethernet interface. A static IP address cannot be configured without this name. To do this, log into your server and issue the command ip a . The output of this command ( Figure A ) will include the name of the interface.

how to assign static ip on centos 7

As you can see, from my output, the name of my interface is enp0s3. Now that we know the name of our interface, we can configure the static address.

Configuring the address

Within the directory /etc/sysconfig/network-scripts/ you should find the file ifcfg-INTERFACENAME (Where INTERFACENAME is the name of your interface). In my instance, the file is ifcfg-enp0s3. It is important that you configure that file, and not the ifcfg-eth file. Open the correct file for editing with the command sudo nano /etc/sysconfig/network-scripts/ifcfg-enp0s3 . We need to modify that file in order to not only change the protocol from dhcp to static, but to add the specific IP address. So when you open up that file, you’ll want to change:

BOOTPROTO=dhcp

BOOTPROTO=static

Now you’ll need to add the entries to set not only the IP address, but the netmask, gateway, and DNS addresses. At the bottom of that file, add the following:

IPADDR=192.168.1.200 NETMASK=255.255.255.0 GATEWAY=192.168.1.1 DNS1=1.0.0.1 DNS2=1.1.1.1 DNS3=8.8.4.4

NOTE: All fields in bold, you will edit to reflect your networking needs. If you have fewer or more DNS entries, add or remove them as needed.

Save and close that file. In order to make the changes take effect, issue the command sudo systemctl restart network. Once the networking system has restarted, issue the command ip a to see that your IP address has changed to reflect your configuration.

And that’s all there is to setting a static IP address on CentOS. That wasn’t so hard, now was it? Don’t think this technique is limited only to GUI-less CentOS servers. You can use the same method to set a static IP address on a CentOS server with a GUI as well.

Enjoy having more control over your CentOS network interfaces.

Subscribe to the Developer Insider Newsletter

From the hottest programming languages to commentary on the Linux OS, get the developer and open source news and tips you need to know. Delivered Tuesdays and Thursdays

  • How to install Kloxo-Mr hosting control panel on CentOS
  • How to install a GUI on top of CentOS 7
  • How to install cPanel/WHM on CentOS 7
  • How to use the nmcli command to gather network device information on Linux
  • Learn how to run Linux on Microsoft's Azure cloud

Image of Jack Wallen

Create a TechRepublic Account

Get the web's best business technology news, tutorials, reviews, trends, and analysis—in your inbox. Let's start with the basics.

* - indicates required fields

Sign in to TechRepublic

Lost your password? Request a new password

Reset Password

Please enter your email adress. You will receive an email message with instructions on how to reset your password.

Check your email for a password reset link. If you didn't receive an email don't forgot to check your spam folder, otherwise contact support .

Welcome. Tell us a little bit about you.

This will help us provide you with customized content.

Want to receive more TechRepublic news?

You're all set.

Thanks for signing up! Keep an eye out for a confirmation email from our team. To ensure any newsletters you subscribed to hit your inbox, make sure to add [email protected] to your contacts list.

ITzGeek

How To Configure Static IP Address in CentOS 7 / RHEL 7

how to assign static ip on centos 7

Setting up the network and bringing servers into the network is the primary administration task for any system administrator.

In some cases, these tasks are automated using DHCP (Dynamic Network Configuration Protocol) which takes care of assigning IP Address to Desktop/Servers.

READ: How To configure DHCP server on CentOS 7, Ubuntu 18.04 & Debian 9

But, if you go to the bigger organizations, they use static (manual) IP to avoid network issues due non-availability of DHCP servers.

Configure Static IP Address in CentOS 7 / RHEL 7

Let us configure our system for the following information.

IP Address: 192.168.1.10 Netmask: 255.255.255.0 Gateway (Router): 192.168.1.1 DNS Server 1: 192.168.1.1 DNS Server 2: 8.8.8.8 Domain Name: itzgeek.local

Find the available network interfaces on your system

You can use any one of the below commands to list down the available network interfaces on the system.

Choose the desired network interface

The output of ifconfig -a may look like below. Here, I wish to change the IP address of enp0s3.

Configure the Static IP Address

In this method, we will edit the network interface file found under /etc/sysconfig/network-scripts/ directory. For interface enp0s3 , the file name would be ifcfg-enp0s3 .

Update the interface file as per the requirement.

You can also use nmtui , a text-based user interface for configuring network interfaces.

Select Edit a connection and press Enter .

Configure Static IP Address in CentOS 7 - Edit a connection

Choose the network interface and then Edit .

Configure Static IP Address in CentOS 7 - Choose the network interface

Set the IP Address and enter OK .

Configure Static IP Address in CentOS 7 - Configure Static IP Address

Restart Network

Finally, restart the network service using the following command to have these changes take effect.

Verify Static IP Address

Use ifconfig -a command to verify the static ip address.

Also, verify the DNS server entries.

That’s All. I hope you have learned how to configure a static IP address on CentOS 7 / RHEL 7 .

How To Install Oracle Java JDK 12 / 11 / 8 on Debian 10 / Debian 9

How to Configure Let’s Encrypt SSL in OpenLiteSpeed Web Server

How to Install Oracle Java JDK 18 on Linux

How to Install Oracle Java JDK 17 on Linux

How to Upgrade CentOS 7 to Rocky Linux 8

How To Install PHP 8.0 on CentOS 7 / RHEL 7

How To Install NTP (Chrony) On CentOS 8 / CentOS 7 & RHEL 8 / RHEL 7

How To Install Gradle on CentOS 8 / 7 & RHEL 8 / 7

  • CentOS 8 / RHEL 8
  • CentOS 7 / RHEL 7
  • CentOS 6 / RHEL 6
  • LinuxMint 20
  • Linux Mint 19
  • Linux Mint 18
  • Rocky Linux 8
  • Ubuntu 22.04
  • Ubuntu 20.04
  • Ubuntu 18.04
  • MySQL / MariaDB
  • Other Tools

Tecmint: Linux Howtos, Tutorials & Guides

How to Configure Network Static IP Address on RHEL/CentOS 8/7

The scope of this tutorial is to explain how we can edit and make changes to Network Configurations on RHEL/CentOS 8/7 from the command line only, and, more specifically how we can set up a Static IP address on network interfaces using system network-scripts, which is a must be configured to serve Internet-facing network services, and how to configure or change RHEL/CentOS system hostname .

Configure Network Interface in CentOS 7

Also will show you, how we can manage or disable unwanted system services, such as Network Manager , which is no longer needed in-case you use a manual static IP configured on network scripts, Avahi-Daemon which is, also, not needed on a server and represents a seriously security gap, unless you installed the server on your Laptop and you want to instantly browse your network for other services, and on the final will present you Network Manager Text User Interface – nmtui , a system utility that can ease the job of editing your system network settings with advanced Interface configurations like creating Bond , Bridge , Team and VLAN Interfaces.

Requirements

  • Installation of “CentOS 8.0″ with Screenshots
  • Installation of RHEL 8 with Screenshots
  • How to Enable RHEL Subscription in RHEL 8
  • CentOS 7.0 Minimal System Installation
  • RHEL 7.0 Minimal System Installation
  • Active RHEL 7.0 Subscriptions and Functional Repositories

Also, be aware that most of the configurations offered by editing system files should not be performed from a remote location using SSH service until you establish a continued and reliable network connection using a fixed IP address.

On this page

  • Disable Unwanted Services in CentOS
  • Set Static IP Address on CentOS
  • Set Hostname in CentOS
  • Set Static IP Address on CentOS Using Nmtui Tool

Step 1: Disable Unwanted System Services in CentOS

1. Before actually starting to do anything we need to make sure that our system has some necessary editing and networking tools like netstat , ifconfig , wget , curl , and lsof installed, some of them will not be used on this step but it’s better to have them installed for future configurations.

Install Networking Tools in CentOS

2. After the tools have installed run ifconfig to get your Network Interfaces settings and status, and, then run netstat or lsof command to check what services are running by default on our server.

Check Network Interfaces and Services Status

3. The netstat command output is pretty self-explanatory and shows a list of sockets associated with their running program name.

If, for example, our system will not be used as a mail service you can stop Postfix master daemon which runs on localhost and, also stop and disable other unwanted services using the following commands – the only service I advise not to stop or disable for now is SSH if you need remote control over the server.

Stop Postfix Service

Stop Postfix Service

Stop Avahi Daemon Service

Stop Avahi Daemon

4. You can, also, use old init commands to stop or disable services but since Red Hat now implements systemd process and service management, you should better get used to systemctl commands and use it often.

If you use Arch Linux then it should be a piece of cake to switch to systemd – although all init commands now are linked and pass-through systemd filter.

5. If you want to get a list of all started services run the service command and for an exhaustive report use systemctl .

List All Services in Linux

6. To manage services run the systemctl command using the most important switches: start , stop , restart , reload , disable , enable , show , list-dependencies , is-enabled, etc. followed by your service name.

Also, another important feature that the systemctl command can also run on a remote server through SSH service on a specified host using -H option and perform the same actions as locally.

For example, see the command and screenshot below.

Run systemctl on Remote Server

Step 2: Configuring Static IP Address on CentOS

7. Before start editing Network Interface Card system files make sure that from now on and until you set static IP, you have physical or any other type of access to your server, because this step requires bringing down your network interface and connections.

Although it can be done smoothly without disrupting your connectivity and activate connection after reboot . There is no way you can test it before reboot if you only have a single NIC attached. Still, I will present to you with the entire method and indicate the steps needed to be avoided in case you want to maintain your connectivity and test it afterward.

8. Now move to /etc/sysconfig/network-scripts/ path, open and choose your Network Interface you want to assign static IP for editing – to get all NICs names to use ifconfig or IP command as shown.

Check Network Interface Name

9. Next, use the following network template to edit the file and make sure that the ONBOOT statement is set on YES , BOOTPROTO is set to static or none and don’t change HWADDR and UUID values provided by default.

Make the following changes as shown.

Configure IP Address in CentOS 8

10. After finishing editing the file, close it, and move to resolv.conf file if you want DNS servers enabled system-wide.

Here just add your DNS servers using nameserver statement.

11. Now Network Interface is configured with a static IP, the only thing remaining is to restart your network or reboot your system and use ifconfig or IP command to view the IP address and test configuration using ping command.

NOTE : After restart use the newly static IP address configured to perform remote login with SSH.

Check New IP Address

Step 3: Setting Hostname in CentOS

12. To adjust system hostname system-wide, open hostname and hosts file located on /etc path and edit both the following way.

Hostname File

Here you can add just the name of the system but it’s a good idea to append the .dot domain to.

Here add the same hostname as above on the 127.0.0.1 line before the localhost.localdomain statements.

Set Hostname in CentOS 7

Alternatively, you can set hostname using the hostnamectl command as shown.

13. To test if your hostname is correctly set use hostname command.

Step 4: Set Static IP Address on CentOS Using Nmtui Tool

14. NetworkManager Text User Interface (TUI) tool, nmtui , is an RHEL intuitive tool which provides a text interface to configure networking by controlling Network Manager, which helps to edit advanced network settings such as assign static IP addresses to Network Interfaces, activate or disable a connection, edit WI-FI connections, set your system hostname or create advanced Network interfaces like InfiniBand, bond, bridge, team or VLAN.

NetworkManager-tui is installed by default in RHEL/CentOS 7.0, but if for some reason its missing issue the following command to install it.

14. To start Network Manager Text User Interface run the nmtui command and use TAB or arrow keys to navigate through and press Enter to select an option. If you want to directly edit or connect a specific interface run the following options.

Configure Static IP in CentOS

If you want to set static IP you can, also, use Network Manager Text User Interface as a facile alternative to actually edit network interfaces files, with a limited number of options that method has to offer, but make sure Network Manager service is enabled and started on your system.

Previous article:

Next article:

Photo of author

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Related Posts

Install NTP Chrony in Linux

How to Install and Configure NTP in RHEL Systems

Install Terraform in Linux

How to Install Terraform (Infrastructure as Code) in Linux

Install GitLab on CentOS 7

How to Install and Configure GitLab on Linux

Create New Services and Units in SystemD

How to Create and Run New Service Units in Systemd Using Shell Script

Install VNC Server in Linux

How to Install and Configure VNC Server in CentOS and RHEL

Migrate CentOS 7 to AlmaLinux 8

How to Migrate CentOS 7 to AlmaLinux 8 Using ELevate Repo

11 thoughts on “How to Configure Network Static IP Address on RHEL/CentOS 8/7”

After 2 hours tests, Good all be fine, it works fine, just Added : In smb.conf file configuration in [Anonymous]

1- be sure that your server has a static connection 2- added user with password : smbpasswd -a username

Thank For Author I have make a samba configuration in 2 hours

I feel learning with quick manner in this site Thank you very much

I also routinely disable NetworkManager on my servers, but do note that “nmtui” (and also nmcli) are NetworkManager clients, so you cannot use them if you have disabled NetworkManager.

Excellent!. This is the ONLY post on setting static IP on Centos which is correct. Simple flow.

All: Just follow the steps as is.

Great explanation. Great job guys.

Great article. The static IP configuration works great on my RHEL 7 server vm.

Just have a question. The Red Hat documentation says that BOOTPROTO should be set to “none”. My copy of your configuration only works with BOOTPROTO=static as you used in your example. If I set it to none the ip address does not get updated. I am having some discussions with our Linux sys admins since they are insisting that I should follow only the Red Had docs and this is a problem as I can’t make it work with BOOTPROTO=none. Is there a reason why it only works with BOOTPROTO=static?

If it works with bootptoto=static then stick with this option as long as it does the job right! As far as i know it should work also with none (none actually specifies that no boot-time protocol should be used but the IP value from IPADDR=1.2.3.4 variable should be updated for NIC at boot time).

@Ehwan Kho: Just use ip link show or ifconfig -a command and you should see all your NICs names. You can also use nmtui to edit your new card settings.

How do I add a new network card – NIC? I tried using lspci | grep Ethernet, it display that it 2 cards. My question now how could I know its name? as they are not using the eth1, eth2 et al.. And I can’t see /etc/udev/rules.d/70-persistent-net.rules. Your thoughts are highly appreciated.

In my opinion you can use both approaches, manual editing NICs interfaces or configure static IP using NM or nmtui if you dont have a GUI. But for a better control and flexibility over your NICs you should go with manual configurations, without NM. If you go with manual without NM don’t forget to use NM_CONTROLLED=no and ONBOOT=yes parameters.

please matie cezar can you teach me how to network a small firm. i will be happy if you can teach me form scratch to the level of networking a firm. i want to learn the installation and configuration

I ALWAYS disable network manager on Servers, it’s too dynamic and wastes resources. Why Red Hat is pushing that crap I don’t know, but I haven’t met anyone who wants it on a server. It’s great for desktops, and laptops, but NOT servers. Also, the DNS settings need to stick to being setup in the resolv.conf file, not spread out in the ifcfg scripts. Keeps the config manageable and easy to troubleshoot.

From going over the documentation on RHEL/CentOS 7, it appears that they’re really pushing for NetworkManager to be the default way to manage networking. For servers (not desktop) do you believe it’s best to disable NetworkManager and just assign static IPs normally as you have instructed or do you believing managing all the network through net manager is worth it?

The reason I ask is because I only deal with servers (not desktops) and I’ve seen many times NetworkManger causing major network issues. So I’m still on the fence whether or not to do things through netManager. Specially considering that rhel 7 is using it by default.

Got something to say? Join the discussion. Cancel reply

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.

Save my name, email, and website in this browser for the next time I comment.

Stack Exchange Network

Stack Exchange network consists of 183 Q&A communities including Stack Overflow , the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

How can I set a static IP address in CentOS 7?

I have a CentOS 7 Minimal VirtualBox VM that I would like to set a static IP address on. I want to assign the static IP address via a Bash script within the VM (so not using the VirtualBox network interface).

How can this be done?

So far I've tried editing the file : /etc/sysconfig/network-scripts/ifcfg-enp0s8 , and putting the below in it (per this question: https://superuser.com/a/365088 ).

But then the network adaptor doesn't restart ( service network restart ), which after a considerable amount of restarts/resets/trial, and error, and copious Google searches, it seems like it could be dozens of different things.

ip a lists two devices:

I also have a ifcfg-enp0s3 config file in the sysconfig dir (not sure why).

So, what's a nice, simple, predictable, reliable way of setting a static IP address in CentOS 7 minimal?

Giacomo1968's user avatar

  • 1 The answer you linked to is correct. –  Ramhound Sep 9, 2017 at 19:12
  • ipcfg-en0s3 –  Ramhound Sep 9, 2017 at 19:50
  • @Ramhound - That may be the "correct" answer, but I'm afraid it's not a working answer. Sure, if I do ip a it reports that enp0s8 is on my new, desired IP address, and I can ping that address from the client itself, but the host machine can't access it. And as noted above, in this configuration, service network restart returns FAILED, although I've just got rid of that by simply deleting the ifcfg-enps03 file. I still can't externally connect to the client despite being able to on the old address before the change. (And firewalld is stopped). –  linux_confusion Sep 9, 2017 at 21:35
  • Neither the answer linked nor RHEL Documentation has quoted values. Did you try your configuration without quotes? –  sebasth Sep 10, 2017 at 6:57
  • @sebasth - the file that already exists (and thus shipped with CentOS) has quote marks. However I've tried both with and without and they make no difference. –  linux_confusion Sep 10, 2017 at 8:34

Try following:

I believe your problem is primary in the missing NM_CONTROLLED=no. Except of network restart you may try to set it UP with

You may also need to specify GATEWAY=

Jaroslav Kucera's user avatar

You must log in to answer this question.

Not the answer you're looking for browse other questions tagged linux networking virtualbox centos ..

  • The Overflow Blog
  • Who owns this tool? You need a software component catalog
  • Down the rabbit hole in the Stack Exchange network
  • Featured on Meta
  • Upcoming privacy updates: removal of the Activity data section and Google...
  • Changing how community leadership works on Stack Exchange: a proposal and...

Hot Network Questions

  • Is there any ethical problem with a tiered grading system?
  • Is there a way to do Tukey's HSD test for the combined results of a one-way ANOVA and a two-way ANOVA? Or should both be followed by separate tables?
  • Why does the Falcon 9 first stage perform a burn at 60 km altitude?
  • Does Hungary have anything to gain from defending Israel's actions in Gaza?
  • How to set iptables to block incoming requests to the server but still have internet connectivity
  • Why would the triangles join up to a rhombus?
  • How are apps selected to be pre-installed
  • Divide rubies and diamonds on a necklace into 2 equal halves
  • Would it be constitutional for a US state or the federal government to ban all homeopathic "medications"?
  • Is there global law that governs Denaturalization to stateless status for children?
  • Oxidation of compounds vs elements
  • Will there be another joint International Space Station (ISS) after the current is retired?
  • Recursive macros revisited
  • What qualities or factors contribute to Qatar being considered a suitable mediator between Venezuela and the United States?
  • How to prove that the following series converges?
  • How to use sed to remove newlines above and below a string?
  • The Purpose of Writing
  • Swap letter cases
  • Apply different materials to same geo node setup
  • What's the source of John Adams's quote against the two-party system?
  • Roots of quartic equation - given product of two roots, find missing coefficient
  • Is there a name for the widespread logical fallacy in which you prove your point by 'eliminating' anyone who contradicts you?
  • Can "innate" magic exist without fostering elitism?
  • 10-year UK visa ban. 15 years later and new citizenship

how to assign static ip on centos 7

how to assign static ip on centos 7

How to configure a static IP address on CentOS 7

Last updated on November 7, 2020 by Dan Nanni

If you want to set up a static IP address on a network interface in CentOS 7, there are several different ways to do it, varying depending on whether or not you want to use Network Manager for that.

Network Manager is a dynamic network control and configuration system that attempts to keep network devices and connections up and active when they are available). CentOS/RHEL 7 comes with Network Manager service installed and enabled by default.

To verify the status of Network Manager service:

To check which network interface is managed by Network Manager, run:

how to assign static ip on centos 7

If the output of nmcli shows connected for a particular interface (e.g., enp0s3 in this example), it means that the interface is managed by Network Manager. You can easily disable Network Manager for a particular interface, so that you can configure it on your own for a static IP address.

Here are two different ways to assign a static IP address to a network interface on CentOS 7 . We will be configuring a network interface named enp0s3 .

Configure a Static IP Address without Network Manager

Go to the /etc/sysconfig/network-scripts directory, and locate the configuration file of the interface ( ifcfg-enp0s3 ). Create it if not found.

how to assign static ip on centos 7

Open the configuration file and edit the following variables:

how to assign static ip on centos 7

In the above, NM_CONTROLLED=no indicates that this interface will be set up using this configuration file, instead of being managed by Network Manager service. ONBOOT=yes tells the system to bring up the interface during boot.

Save changes and restart the network service using the following command:

Now verify that the interface has been properly configured:

how to assign static ip on centos 7

Configure a Static IP Address with Network Manager

If you want to use Network Manager to manage the interface, you can use nmtui (Network Manager Text User Interface) which provides a way to configure Network Manager in a terminal environment.

Before using nmtui , first set NM_CONTROLLED=yes in /etc/sysconfig/network-scripts/ifcfg-enp0s3 .

Now let's install nmtui as follows.

Then go ahead and edit the Network Manager configuration of enp0s3 interface:

The following screen will allow us to manually enter the same information that is contained in /etc/sysconfig/network-scripts/ifcfg-enp0s3 .

Use the arrow keys to navigate this screen, press Enter to select from a list of values (or fill in the desired values), and finally click OK at the bottom right:

how to assign static ip on centos 7

Finally, restart the network service.

and you're ready to go.

Support Xmodulo

This website is made possible by minimal ads and your gracious donation via PayPal or credit card

Please note that this article is published by Xmodulo.com under a Creative Commons Attribution-ShareAlike 3.0 Unported License . If you would like to use the whole or any part of this article, you need to cite this web page at Xmodulo.com as the original source.

how to assign static ip on centos 7

Xmodulo © 2021 ‒ About ‒ Write for Us ‒ Feed ‒ Powered by DigitalOcean

How to Configure a Static IP address on CentOS/RHEL 7

This post explains how a static IP address can be set on CentOS/RHEL 7. We can configure the static ip address in /etc/sysconfig/network-scripts/* by setting the properties in the /etc/sysconfig/network-scripts/ifcfg-[interface] file. Here [interface] is the interface of your choice to which you want to assign an IP address.

Sample Example

Below are basic configuration instructions to setup a static IP address on CentOS/RHEL 7.

1. First, list your network interfaces with ip command:

Make a note of network interface you would like to set with static IP address.

2. Next, locate a corresponding script to the network interface name. In our case this is enp0s3 located at /etc/sysconfig/network-scripts/ifcfg-enp0s3.

3. Open this file and enter the following information. Note that your HWADDR,DEVICE,UUID will be different:

4. The above will set our enp0s3 network interface with static IP address 10.1.XX.110. Once you have made the necessary changes restart the system networking using below command:

5. Confirm that your IP address has been updated:

  • How To Change Engine Database Password for OLVM Engine
  • Oracle Linux Virtualization Manager(OLVM) Engine PostgreSQL Database Queries Cheat Sheet
  • How to Configure firewalld in CentOS/RHEL 8 using "Web Console" and "firewall-cmd"
  • Troubleshooting Booting Issues in CentOS/RHEL 7 and 8
  • How to Mount NFS Shares using Automounter in CentOS/RHEL
  • How to reset or recover root password in CentOS/RHEL 8
  • Understanding CentOS/RHEL 8 Boot Process
  • Beginners Guide to Stratis local storage management in CentOS/RHEL 8
  • How to Compress and Deduplicate Storage with VDO in CentOS/RHEL 8
  • How to Extend a Logical Volume in LVM - for XFS, ext4 and swap filesystem

Latest Posts

  • How to Create Index Partitions To Ranged Partitioned Table
  • How to Move Partition Online in Oracle 12c
  • How to add or modify Printer settings in CentOS/RHEL using GUI
  • What is machine-id in Linux

Learning and Sharing

  • Windows Server
  • Microsoft Azure
  • PowerShell Learning
  • Microsoft Graph
  • Auto Installation
  • AEC Installation

How to Assign a Static IP for a CentOS 7 or RHEL 7

Table of contents.

Typically, in most network configurations, the IP address is assigned dynamically by the router DHCP server . Setting a static IP address may be required in different situations, such as configuring port forwarding or running a web server behind a NAT.

This post explains how to set up a static IP address on a CentOS 7/RHEL 7 server.

Find the available network interfaces

You can use any one of the below commands to list down the available network interfaces on the system.

The command prints a list of all the available network interfaces. In this example, the name of the interface is ens160 .

Configuring the Static IP Address of CentOS 7/RHEL 7

1. In this method, we will edit the network interface file found under /etc/sysconfig/network-scripts/ directory. For interface ens160, the file name would be ifcfg-ens160 .

2. To assign a static IP address to the interface , update the interface file as per the requirement.

  • Set BOOTPROTO : none .
  • Specify the static IP address. Under addresses: you can add one or more IPv4 or IPv6 IP addresses that will be assigned to the network interface.
  • Specify the gateway4 .
  • Under nameservers, set the IP addresses of the nameservers.

3. Restart the network service to take the changes go into effect.

4. Use ifconfig -a command to verify the static ip address.

Also, verify the DNS server entries in /etc/resolv.conf file.

Finally , verify the internet connectivity using the ping command:

You can also use nmtui , a text-based user interface for configuring network interfaces.

1. Run the following command to install NetworkManager Text User Interface nmtui if it is not installed.

2. Run nmtui tool.

3. Select Edit a connection and press Enter .

Bg2203

4. Select the network interface and then Edit .

Bg2205

5. In the following screen, change IPv4 Configuration from Automatic to Manual .

Bg2209

6. Set the IP Address, Gateway and DNS servers then enter OK .

Bg2206

To make above changes into the effect, deactivate and activate the connection or restart your server.

That’s it! You have assigned a static IP to your CentOS 7 or RHEL 7 server.

How to Assign a Static IP for a CentOS VM in VMware

How to assign a static ip for a centos 8 or rhel 8, related posts.

Ftr20

How To Install or Update OpenSSL 3 on CentOS 8 Linux

How to install ioncube loader in centos 8, how to display file size in kb, mb or gb in linux terminal.

Ftr40

The Repository cdrom Does not Have a Release File in Ubuntu

How to install or update openssl 3 on centos 7, how to install or update openssl 1.1.1 on centos 7, leave a reply cancel reply.

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

Save my name, email, and website in this browser for the next time I comment.

Recent Posts

  • How to Launch Windows Sandbox with Winget Enabled Automatically
  • How to Move Contact from the Left Side to Bottom in Microsoft Outlook
  • How to Disable Save As Defaulting to OneDrive in Microsoft Office

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Join the movement and receive our weekly Tech related newsletter. It’s Free.

Microsoft Windows

  • Microsoft Office
  • Microsoft 365

Microsoft Teams

Email Servers

how to assign static ip on centos 7

Copyright 2024 © All rights Reserved. Design by Leo with ❤

  • Active Directory

UbuntuMint – Everything About Ubuntu Linux

How to Set a Static IP Address in CentOS Linux

An IP ( Internet Protocol ) Address is a unique numerical representation of a computer on a network. Every computer connected to the Internet is identified by an IP Address.

Usually, IP addresses are dynamically assigned to a computer by a dedicated server called DHCP Server ( Dynamic Host Control Protocol ), and hence change from time to time as and when the connection is lost and reestablished.

However, there are scenarios where a static IP address is more preferable; Eg. In large corporations, where it removes the load of using DHCP for each computer in the organization.

Today, we will learn how to set a static IP address on a local network in CentOS .

List Network Interface Name

A computer can be connected to one or more network interfaces, for example to a WiFi device and a LAN device, which has different IP addresses for each interface.

Run the following command to show the interface names.

List Network Interface Names

The interface ‘ enp0s3 ‘ is the LAN device connected to my computer and the IP Address is ‘ 10.0.2.15 ‘. The other interface ‘ lo ‘ ( Loopback ) which is nothing but the local network of the computer within itself. Thus my computer is only connected to one interface, ‘ enp0s3 ‘.

Configuring Static IP Address in CentOS

Go to directory ‘ /etc/sysconfig/network-scripts ‘ and list the files; you should see a file corresponding to your network interface.

List Network Interface Files

Open the file ‘ifcfg-enp0s3’ using ‘ Vim ‘ or any editor of your choice.

Set the following values for the variables. Change the values according to the IP address and subnet that you need to set.

Set IP Address in CentOS

Save and exit the file. Restart the networking service with the following commands:

Finally, run ‘ ifconfig ‘ again to verify if static IP has been set.

Verify IP Address in CentOS

In this article, we saw an easy way to set an IP address in CentOS. The example, in this case, is a static IP on the local network, i.e., it is not a static public IP over the Internet.

To set a static public IP address over the Internet, you need to purchase the IP Address and configure it in the file as shown above, along with other details like DNS server, network prefix, which will be provided by your Internet Service Provider.

Thanks a lot for reading and let us know your thoughts in the comments below!

How to Install Software from Source in Linux

How to Disable SSH Login to Specific User in Linux

Photo of author

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

RECOMMENDED ARTICLES

What are CentOS and CentOS Stream and History

How to Create Sudo User in RHEL, CentOS, Rocky & AlmaLinux

How to Install Remi Repo in RHEL, CentOS, Rocky, & AlmaLinux

How to Install Suricata on RHEL, Rocky & AlmaLinux

How to Install FTP with SSL in Rocky Linux and AlmaLinux

Learn Different Networking Options in VirtualBox

How to Install Guest Additions in Virtualbox VM

How to Install CentOS 7 Minimal in Virtualbox

How to Host a Website on NGINX Web Server

How to Host a Website on an Apache Web Server

Got something to say? Join the discussion. Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Save my name, email, and website in this browser for the next time I comment.

logo

How To Configure a Static IP Address on CentOS 7/8

  • Knowledge Base
  • Networking 6
  • Webhosting 10
  • Virtualisation 2

Introduction

This guide details howto configure a static IP on CentOS 7 or 8 on an operating system installed without a GUI.  There are a number of options/methods available to do this outlined below.

Method 1 – Using Network Configuration File

1) First determinte the name of your network adapter by running the following:

2) Using your favourite text editor open the configuration file for your network adapter, replacing X with the name of your network adapter determined in the previous step.

3) Configure the variables in the file for your conneciton:

4) The most common configuration parameters with explanations are:

BOOTPROTO= none, bootp or dhcp IPADDR= DEVICE=<name> –> where <name> is the name of the physical device. DNS{1,2}=<address> –> where <address> is a name server address to be placed in /etc/resolv.conf GATEWAY= MACADDR=<MAC-address> –> Where <MAC-address> is the hardware address of the Ethernet device in the form AA:BB:CC:DD:EE:F NETMASK=

ONBOOT=<answer> –> Where <answer> is one of the following: yes — This device should be activated at boot-time. no — This device should not be activated at boot-time.

PEERDNS= yes – Modify /etc/resolv.conf if the DNS directive is set. If using DHCP, then yes is the default. no – Do not modify /etc/resolv.conf.

USERCTL= yes  – Non-root users are allowed to control this device. no – Non-root users are not allowed to control this device.

4) If you have NetworkManager service running, you’ll need to instruct the network service that network manager doesn’t manage this interface (eth0). This is done by adding the line:

5) Then you can stop NetworkManager service. For CentOS 7/8, this can be done using:

6) After saving the changes, the shut down the interface and bring it back:

7) Then you can stop NetworkManager service. For CentOS 7/8, this can be done using:

8) Check the current adapter settings:

Method 2 – Using ip and ifconfig commands

The ifconfig command is now depreciated in favour of ip tool however is still part of net-tools package and can be installded with:

For clarity in the steps below both iptool and ifconfig commands are shown:

Show Adapters

To show all ip address related infoprmation is ip/config these commands are used:

Bring Up/Down an Interface

Setting a static ip.

Static IP setting can be done using ip or ifconfig. But note that changes made with these commands are not persistent against reboots:

Removing a static IP

Clearing IP information can be done as follows:

Add default route via gateway IP

A default route can be set using ip and ifconfig commands for destinations without static routes defined.

Method 3 – Using Network Manager (nmcli)

In RHEL and CentOS 7 and 8 the networking service is managed by the NetworkManager daemon and it is used to dynamically configure and control network devices and keep connections up and active when they are available.

Howto remove NetworkManager

In case you don’t want to remove network manager you can disable and remove it as follows:

Incase you do wish to use NetworkManager then a reference of commands can be found below:

Howto start NetworkManager

You can check Network Manager is running and started as follows:

Bring Up interfaces using NetworkManager

You can bring network interfaces up and down using network manager as follows:

Configure a static IP using NetworkManager

1) List current connections

2) Delete connections entering UUID or network name from Step 1

3) Create a network with name ethX

4) Configure DNS and make network configurations always be manual for this network interface.

5) Restart the network:

6) View the connection ethX

supermicro server

– Limited Offer –

Dual Core Xeon E3-1220L 2.20Ghz 

Only £29/Month 

Press ESC to close

how to assign static ip on centos 7

Easy guide to assign Static IP Address on CentOS / RHEL (7 & 8)

DHCP servers are used almost in all organizations or even in our home routers for assigning IP addresses to get access to the internet. Usually, when we enable our network interface on our CentOS 7 or 8 systems, an IP address is assigned automatically through that DHCP server & we have access to the internet or to our LAN network. But we might be required to assign static IP addresses in our CentOS 7 or 8 machines.

So what do we do? We need to manually assign a static IP address to our servers. In this tutorial, we will learn how to assign static IP addresses in CentOS 7 or 8 machines.

There are two ways we can assign a static IP address in CentOS 8 systems,

1- Using Network manager 2- Assigning IP using network files

Let's discuss both these methods one by one.

Recommended Read: IP Route command: Create static routes or Change the default Gateway in Linux

Also Read: How to manage network in Ubuntu 18.04 – Netplan Command

1- Assign static IP using Network Manager

To configure a static using the network manager, we will be using a tool called 'nmtui'. NMTUI is a CLI-based user interface for Network Manager & even works for a system that does not have GUI installed.

To assign IP address, open terminal & execute the following command,

You will see the following screen,

assign static ip address

Click on ' Edit a connection ', press ‘ Enter ’. Use the ‘ Tab ’ key to navigate.

On the next screen, select the network interface from the list of interfaces & press ENTER key,

assign static ip address

Add the IP address and other necessary details as required & complete the setup. Next, we need to restart the NetworkManager service to implement the changes,

# systemctl restart NetworkManager

2- Assigning IP using Network files

Network files for all the network interfaces are located in the directory ‘/etc/sysconfig/network-scripts'. Open the primary network interface file i.e. enp0s3, & add the following content to the file. Add what’s not in the file.

$ vi /etc/sysconfig/network-scripts/ifcfg-enp0s3

DEVICE="enp0s3" BOOTPROTO=static ONBOOT=yes TYPE="Ethernet" IPADDR=10.10.10.10 NETMASK=255.0.0.0 GATEWAY=10.10.10.100 HWADDR=32:0A:21:54:ND:6D

Save the file & restart the network service for changes to take effect.

# systemctl restart network

After the service has been started, our static IP has been assigned to our CentOS 8 system. To verify the assigned IP address, use the IP command,

That’s it, this completes our tutorial on how to assign a static IP in CentOS 7 or 8 systems. Please do send in any questions or queries using the comment box below.

We are giving you exclusive deals to try Linux Servers for free with 100$ credit, check these links to claim your 100$,

DigitalOcean - 100$ free credit & Linode - 100$ free credit

Check some Exclusive Deals, HERE .

Also, check out DevOps Book You should read section.

Share Article:

Passionate about Linux & open source. Loves to learn, read & write about Linux as well as new technologies.

Create Ubuntu bootable USB / Live USB from command line

Search a file in linux using find & locate command.

how to assign static ip on centos 7

on this example “$ vi /etc/sysconfig/network-scriptsifcfg-enp0s3” I believe you left out a forward slash after network-scripts and before ifcfg-enp0s3. It should read “$ vi /etc/sysconfig/network-scripts/ifcfg-enp0s3”

Avatar

Thanks for mentioning it, it’s been updated.

Leave a Reply Cancel reply

Save my name, email, and website in this browser for the next time I comment.

  • IT Management
  • Infrastructure
  • High Performance

LinuxToday

How to configure a static IP address on CentOS 7 / RHEL 7

On CentOS 7 or RHEL 7 one need to use the NetworkManager daemon. It attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces, like Ethernet, WiFi, and Mobile Broadband devices. In this quick tutorial you will learn about configuring a network interface using ifcfg files located in /etc/sysconfig/network-scripts/ directory in a CentOS 7 and RHEL 7.

Get the Free Newsletter!

Subscribe to Developer Insider for top news, trends, & analysis

How to Install CSF (Config Server Firewall) on Debian 12

How to set up rate limiting in nginx, libreoffice alternatives for linux, how to install dokuwiki on debian 12, how to install zammad customer support system on debian 12.

LinuxToday is a trusted, contributor-driven news resource supporting all types of Linux users. Our thriving international community engages with us through social media and frequent content contributions aimed at solving problems ranging from personal computing to enterprise-level IT operations. LinuxToday serves as a home for a community that struggles to find comparable information elsewhere on the web.

  • Privacy Policy
  • California – Do Not Sell My Information

Advertiser Disclosure: Some of the products that appear on this site are from companies from which TechnologyAdvice receives compensation. This compensation may impact how and where products appear on this site including, for example, the order in which they appear. TechnologyAdvice does not include all companies or all types of products available in the marketplace.

How to setup a static IP address on Centos 7 / RHEL 7

how to assign static ip on centos 7

In this article we will explain how to setup a static IP address on Centos 7 / RHEL 7.There are several ways to configure a static IP address.

1. nmtui Tool ( Network Configuration Text User Interface) 2. nmcli Tool ( Network Manager Command Line ) 3. Editing /etc/sysconfig/network-scripts/ifcfg-network_interface_name.fcg

For this tutorial, we’re going to assign to my server on my lab environment: – IP address : 192.168.1.10 – NetMask 255.255.255.0 – Gateway 192.168.1.1 – Domain Name Servers : 192.168.1.2 192.168.1.3 ( In my lab environment i’ve two Dns Servers) – Search Domains : yallalabs.com

Before starting let’s check current IP address and of our Centos 7 / RHEL 7 server :

Here, like you see, my network interface name is enp0s3 and the network configuration is automatically assigned by my DHCP server. Let’s start setting up a static ip address to our server .

1./ nmtui tool:

nmtui set a static ip address centos 7 rhel 7

Remember to check Automatically connect   to start the network device on boot and click ok .

By the way you can directly edit or connect an interface network device using:

Finally, restart the Network configuration daemon

2. nmcli Tool ( Network Manager Command Line )

First, let’s display the network connections.

Let’s start.

if you want to display list of all informations of the network connection use this command.

3. Editing /etc/sysconfig/network-scripts/ifcfg-network_interface_name.fcg

BY default the configuration file will look like the block below.

  To change the above setup to a static IP address configuration, replace BOOTPROTO value from dhcp to static or none as shown below.

Then add the IP address, network mask, gateway, domain search and Dns for the server at the end and save the file.

Finally, restart the network service to insecure change takes effect.

  That’s it for now. Enjoy..  

PS. If you like this post please share it with your friends on the social networks using the buttons below.Thanks. YallaLabs

' src=

Lotfi Waderni

I'm a technical writer with a background in Linux and windows server administration.

How to change the Hostname on CentOS 7 / RHEL 7

How to setup a static ip address on ubuntu 16 lts, you may also like, how to install python 3.7 on ubuntu..., how to collect windows event logs to..., installing and configuring percona xtradb cluster high..., how to install postgresql on ubuntu 20.04, leave a comment cancel reply.

MicroHost

Did You Know?

Utho

Special Offer

Deploy your Cloud Server now and get $100 in Free Credits!

  • 5 Best practices for configuring and managing a Load Balancer
  • 5 Most Effective Ways to Avoid Cloud Bill Shocks.
  • 6 Benefits of Deploying a Load Balancer on your server.
  • 6 Cloud Computing Myths, Busted!
  • 7 Reasons Why Cloud Infrastructure is Important for Startups
  • Advantages and Challenges of Developing Cloud-Native Applications
  • Advantages and Challenges of Implementing a Hybrid Cloud Solution
  • Advantages and challenges of implementing edge computing in your organization
  • Advantages and Challenges of Using AI and Machine Learning in the Cloud
  • Advantages and Challenges of Using Cloud-Based Analytics Tools
  • Advantages and Challenges of Using Kubernetes and Containers in the Cloud
  • AutoScale Unleashed: Step-by-Step Guide for Implementation
  • Bash vs. CMD: Decoding the Battle of Command Line Titans
  • Benefits of Cloud Computing for Small Businesses
  • Benefits of using Cloud Servers compared to Physical Servers
  • Best Cloud Platform for Your Business
  • Best Practices for Implementing Serverless Computing in Your Organization
  • Best Practices for Managing and Securing Edge Computing Devices
  • Best VPS Hosting Providers in 2023
  • Beyond Boundaries: Ensuring Safety with IPsec Tunnels
  • Can Artificial Intelligence Replace Teachers? The Future of Education with AI
  • Challenges of Cloud Server Compliance
  • Cloud Automation: Empowering Business Dynamics
  • Cloud Cost Optimization: Maximizing Efficiency and Saving
  • Cloud Disaster Recovery: Empowering Business Continuity
  • Cloud Operating System: Next Frontier of Technological Evolution
  • Cloud or In-House Server: Which is best for your business?
  • Cloud Snapshot: Your Shield in the Cloud Server Realm
  • Collaborating DevOps and SRE for Efficient Cloud Migration
  • Compliance in the Cloud: Understanding Your Responsibilities
  • Comprehensive Guide to Troubleshoot SSH Connectivity Issue
  • Configure Let's Encrypt SSL on Ubuntu with Certbot
  • Connecting Utho's Object Storage to Your Phone: A Step-by-Step Guide
  • Create Your Custom Stack on Utho Cloud Dashboard with These Easy Steps
  • Customer-Centric Cloud: How Human Support Enhances User Experience
  • Data Guardian: VPC Elevate Cloud Security to New Heights
  • Decoding DDoS: Safeguarding Your Network
  • Deploying and Managing a Cluster on Utho Kubernetes Engine (UKE)
  • DNS Manager: Enhancing Security and Performance
  • Docker vs. Kubernetes: Containerization Solution for Businesses
  • Edge Computing: A User-Friendly Explanation
  • Empowering Business Success through Strategic Data Backup
  • Enable/disable 2fa on mobile/email for Utho Dashboard
  • Ethics and Regulation of AI: The Next Frontier for Artificial Intelligence
  • Exploring Cloud Computing Scalability: An In-Depth Analysis
  • Green Cloud Computing – Sustainability in Cloud Usage
  • How Cloud Firewall Can Help You to Avoid Costly Data Breaches.
  • How SSL Certificates Keep You and Your Business Secure from Cyber Attacks.
  • How to Choose a Best Cloud Hosting Provider
  • How to Choose the Right Kubernetes Solution for Your Business
  • How to Choose the Right Multi-Cloud Management Tool for Your Business
  • How to keep your Business Documents Safe from Online Threats
  • Impact of Cloud Server Energy Consumption
  • Impact of Cloud Server Location on Latency
  • Instructions for Migrating to a Utho Cloud Environment
  • Introduction to AI and Machine Learning in the Cloud: What Are They and How Do They Work?
  • Introduction to Big Data Analytics in the Cloud: What are the Benefits?
  • IPv6: A Gateway to Cost-Effective Networking
  • Making Email Easy: How to Set Up a Mail Server on Ubuntu
  • Microservices vs. Monolith: Choose Right architecture for Business
  • Multi-Cloud Strategy: Everything You Need to Know
  • NAT Gateway: Your Key to Seamless Cloud Connectivity
  • Navigating the Data Landscape with Block Storage Solutions
  • Navigating the Digital Highway: The World of Virtual Routers
  • Object Storage: Gateway to Modern and Streamlined Data Management
  • Object Storage: Shaping the Future Landscape of Data Storage
  • Pros and Cons of Using Serverless Computing in Your Business
  • Public VS Private VS Hybrid Cloud: Which is Right for Your Business?
  • Renew with Ease: Let's Encrypt Certificate Guide
  • Reserved IP: Redefining the Future of Cloud Scalability
  • Reset your forgotten Utho Cloud Instance password
  • Revealing SSL: Crafting a Web Connection with Security
  • SaaS, PaaS, and IaaS: A Comparison of Business Models
  • SaaS: Transforming Business in the Digital Era
  • Secure and Govern the Lifecycle of Data with Snapshots Protection
  • Securing Cloud Perimeter: Digital Backbone to your Business
  • Securing Connectivity: Power of SSH Keys for Network Safety
  • serverless computing: What is it and how does it work?
  • The Crucial Role of Cloud Monitoring in Business Success
  • The Dark Side of Cloud Servers: Risks and Threats
  • The Future Landscape of Data Storage: Cloud Data Management
  • The Future of Business Apps: Embracing Cloud-Based APIs
  • The Future of Cloud Server Management
  • The Future of Kubernetes: What to Expect in 2023 ?
  • The Impact of Cloud Server Downtime on Business Operations
  • The Importance of Hosting Your Website on a Cloud Server
  • The Pros and Cons of Multi-Cloud Server strategy
  • The Role of Cloud Servers in Edge Computing
  • Top 05 Cloud Security Threats in 2023 and Proven Strategies to Mitigate Them
  • Top 10 Factors to Consider When Choosing a Cloud Server Provider
  • Ultimate UFW: Securing Your Ubuntu 20.04 - Step-by-Step
  • Unleash the Magic of VPN in Cloud Security
  • Unleashing the Power of Artificial Intelligence: What AI Can Do with Utho Cloud
  • Unlock Machine Learning Potential with CUDA Cores
  • Unlock Network Magic with Traceroute & MTR
  • Utho: Driving IT Modernization via Cloud Adoption
  • Utho: Transforming Cloud Technology in India
  • VPS Hosting: A Beginner’s Guide to Virtual Private Servers
  • What is a Bare Metal Server? An In-Depth Overview
  • What is a Cloud Server ?
  • What is a Cloud Service Provider?
  • What is a Hybrid Cloud and why is it Important?
  • What is Cloud-Native Application Development and Why is it Important?
  • What is Kubernetes and Why is it important?
  • What is VPN and how can it benefit your business?
  • When Was Artificial Intelligence Invented?
  • Why Artificial Intelligence is Important
  • Why Firewalls Are Important For Your Business || Benefits of Using a Firewall
  • Why Ransomware Attacks Are Rising and How You Can Protect Your Business.
  • Will Artificial Intelligence Replace Humans?
  • Show all Docs ( 95 ) Collapse Docs
  • How To Configure BIND as a Private Network DNS Server on CentOS 7
  • How to Install and Configure PowerDNS on centos 7 using MariaDB.
  • 2 Methods for Re-Running Last Executed Commands in Linux
  • 4 Effective Ways to Determine the Name of a Plugged USB Device in Linux
  • An introduction to the Linux alternatives command
  • Archiving and Compressing files with GNU Tar and GNU Zip
  • Change SSH Default Port 22 to Custom Port
  • Cheat sheet for 15 nmcli commands in Linux (RHEL/CentOS) 
  • Command-line internet speed tests in CentOS 7
  • convert rwx permissions to octal format in Linux
  • Create a Zabbix action to deliver an alert message to the user
  • Deploy Django Applications Using Nginx and uWSGI on Ubuntu 14.04
  • Determine All IP Addresses of Live Hosts Connected to the Network in Linux
  • Disable reboot using Ctrl-Alt-Del Keys in RHEL / CentOS 7/8
  • Disable SSH root login in Centos 7
  • Download Online Resources from the Command Line with wget
  • Explanation of iftop command
  • Explanation of less, more and most command in Linux
  • Explore Metabase data using MySQL
  • Find multiple Ways to User Account Info and Login Details in Linux
  • For Application Data Storage on Fedora 14, Use MongoDB
  • Getting Started with SELinux
  • How do I find my Apache version in Plesk
  • How do we install MySQL Workbench on Ubuntu 18.04?
  • How to access CentOS terminal by browser: Shellinabox
  • How to access IBM WAS admin console
  • How to access Linux server using SSH in Windows, Linux and Mac OS.
  • How to access Ubuntu terminal by browser: Shellinabox
  • How to add a swap file in Linux
  • How to Add a User and Grant Root Privileges on CentOS 7
  • How To Add a User and Grant Root Privileges on Ubuntu 18.04
  • How to Add a User to Sudoers in Ubuntu 18.04
  • How to add FTP account in plesk
  • How To ADD OR DELETE DOMAINS AND SUBDOMAIN IN PLESK
  • How to add or remove a User from a Linux Group
  • How To Add User to Sudoers or Sudo Group in CentOS 7
  • How to Allow Remote Connections to MySQL in centos
  • How to Block and unblock Ip in CSF-WHM/Cpanel
  • How to Build Brotli From Source on CentOS 7
  • How to Build Brotli From Source on Debian 9
  • How to Build Brotli From Source on Fedora
  • How to Build Brotli From Source on Ubuntu 20.04 LTS
  • How to change apache2 web folder in Ubuntu
  • How to change date and time in Linux
  • How to Change Default Port of Apache On RHEL/CentOS 7
  • How to change mysql port number in centOS 7
  • How to change SSH port when SELinux policy is enabled
  • How to check and analyze packets by tcpdump command
  • How to Check Disk Performance (IOPS and Latency) in Linux?
  • How to check Disk Speed (Read/Write) HDD, SSD Performance in CentOS 7
  • How to check, disable and enable PHP modules.
  • How to Compress a.bz2 File and How to Uncompress It
  • How to configure an external SMTP server in Plesk
  • How To Configure SFTP Server In Debian
  • How to configure SFTP server on Debian 12
  • How to Connect Node.js Application with MongoDB on CentOS
  • How To Create a New User and Grant Permissions in MySQL
  • How to create an email account in Plesk And set email forwarding
  • How to Create Email Accounts in cPanel
  • How to Create Hard and Symbolic Links
  • How To Create Temporary and Permanent Redirects with Apache on Ubuntu
  • How to Create, Encrypt, and Decrypt Random Passwords in Linux
  • How to enable RDP in Ubuntu OS (Tasksel)
  • How to Execute a Command with a Timeout in Linux
  • How to Extract and Download Tar Files with a Single Command
  • How to Find and Sort Files in Linux Based on Modification Date and Time
  • How to fix "Command not found" error in CentOS
  • How to host a domain on centos 7
  • How to host node.js application on Plesk
  • How To Import and Export Databases in MySQL or MariaDB
  • How to increase and decrease the LVM size
  • How to Install (Linux, Apache, MariaDB, PHP) LAMP Stack on CentOS 7
  • How To Install a PHP Version in WHM
  • How to install aaPanel on Centos 7 by one click
  • How to install aaPanel on Debian by one click
  • How to install aaPanel on Fedora by one click
  • How to install aaPanel on Ubuntu by one click
  • How to Install Anaconda on centos 7
  • How to Install Anaconda on Debian
  • How to Install Anaconda on Fedora
  • How to Install Anaconda on Ubuntu 20.04 LTS
  • How To Install and Configure pgAdmin 4 on Ubuntu 22.04
  • How to install and configure Redis on Ubuntu 22.04
  • How To Install and Manage Supervisor
  • How to Install and Use AIDE on RHEL/CentOS 7/8
  • How to Install and Use Apache Cassandra on Ubuntu 20.04 LTS
  • How to install and use ChatGPT in Linux
  • How to install Apache on CentOS 7
  • How to install Atom Text Editor on Debian 10
  • How to install Atom Text Editor on Debian 12
  • How to install Atom Text Editor on Ubuntu 22.04
  • How to install Certbot on AlmaLinux 8
  • How to install Certbot on AlmaLinux 9
  • How to install Certbot on CentOS 7
  • How to install Certbot on Fedora
  • How to Install ClipGrab on Ubuntu 20.04 LTS to Download YouTube Videos
  • How to install Cockpit on Debian
  • How to install Cockpit on Fedora Server
  • How to install Cockpit on Ubuntu server
  • How to Install Cockpit Web Console in CentOS 7.7
  • How to install Composer on Almalinux 8
  • How to install Composer on CentOS server
  • How to install Composer on Debian servers
  • How to install Composer on Fedora
  • How to install Composer on Ubuntu 20.04
  • How to install CSF in cPanel
  • How to install CWP in Centos 7
  • How to Install CyberPanel on CentOS 7
  • How to install Django on Debian server
  • How to install Django on RockyLinux 8
  • How to Install Django on Ubuntu 22.04
  • How to install Docker on AlmaLinux 8
  • How To Install Docker on Centos 7
  • How To Install Docker on Debian
  • How To Install Docker on Fedora
  • How to install Docker on Fedora
  • How To Install Docker on Ubuntu 20.04
  • How To Install Docker on Ubuntu 22.04
  • How to install Drupal on CentOS server
  • How to Install Drupal on Debian
  • How to install Drupal on Fedora
  • How to Install Drupal on Ubuntu server
  • How to Install Elasticsearch on CentOS 7
  • How to install Elinks on AlmaLinux
  • How to install Elinks on CentOS
  • How to install Elinks on Debian
  • How to install Elinks on Fedora
  • How to install Elinks on Ubuntu
  • How to install Flatpak on Debian
  • How to install Flatpak on Debian 12
  • How to install Flatpak on Fedora 35
  • How to install Flutter on Debian
  • How to install Flutter on RockyLinux 8
  • How to install Flutter on Ubuntu 20.04 LTS (Focal Fossa)
  • How to Install FTP on CentOS 7 and access server via Filezilla Client
  • How to install Gawk on CentOS
  • How to install Gawk on Debian 10
  • How to install Gawk on Debian 12
  • How to install Gawk on Debian 9
  • How to Install Gawk on Ubuntu 20.04
  • How to install Gawk on Ubuntu 22.04
  • How to install Git on AlmaLinux 8
  • How to install Git on CentOS 7
  • How to install Git on Debian 10
  • How to install Git on Debian 12
  • How To Install Git on Fedora
  • How to install Git on Fedora
  • How to Install Git on Ubuntu 20.04
  • How to install Git on Ubuntu 22.04
  • How to install GitLab on AlmaLinux 8
  • How to install GitLab on CentOS 7
  • How to install GitLab on Debian 10
  • How to install GitLab on Debian 11
  • How to install GitLab on Debian 12
  • How to install GitLab on Ubuntu 22.04
  • How to install GNOME Desktop (GUI) on CentOS 7
  • How to install GO on Alma Linux
  • How to install Go on CentOS
  • How to install Go on Debian 10
  • How to install Go on Debian 12
  • How to install GO on Fedora
  • How to install GO on Rocky Linux
  • How to install Go on Ubuntu 22.04
  • How to install Gogs on Debian
  • How to install Gogs on Debian 12
  • How to install Gogs on Ubuntu 20.04
  • How to install Gogs on Ubuntu 22.04
  • How to install Google authenticator on Centos
  • How to install Gradle on AlmaLinux 8
  • How to install Gradle on CentOS 7
  • How to install Gradle on Debian 10
  • How to install Gradle on Debian 12
  • How to install Gradle on Debian 9
  • How to install Gradle on Fedora
  • How to install Gradle on Ubuntu 20.04
  • How to install Grafana On Almalinux 8
  • How To Install Grafana on Centos 7
  • How To Install Grafana on Fedora 35/34/33/32/31
  • How to Install Grafana on Ubuntu 20.04
  • How to install Hastebin on Debian 10
  • How to Install Hastebin on Ubuntu 20.04
  • How to Install HTMLDoc on Centos 7
  • How to Install HTMLDoc on Debian 10
  • How to install HTMLDoc on Debian 12
  • How to Install HTMLDoc on Debian 9
  • How to Install HTMLDoc on Fedora
  • How to Install HTMLDoc on Ubuntu 20.04
  • How to install IBM Installation Manager in Linux
  • How to install Java on Almalinux 8
  • How To Install Java on CentOS server
  • How To Install Java on Fedora server
  • How to install Jenkins on CentOS 7
  • How to install Jenkins on Debian 10
  • How to install Jenkins on Fedora server
  • How to install Jenkins on Ubuntu 20.04
  • How to Install Jshon on Ubuntu 20.04
  • How to Install KDE Desktop(GUI) on CentOS 7
  • How to Install KubeSphere on Ubuntu 22.04
  • How to install LAMP on Ubuntu 18.10
  • How to install Laravel Application on Plesk server
  • How to Install Latest MySQL 5.7 on CentOS 7
  • How to install latest versions of PHP on CentOS
  • How to install LEMP on ubuntu 18.04
  • How to install LEMP on Ubuntu 22.04
  • How to install LEMP stack on centOS 7
  • How to install Lighttpd, MariaDB and PHP on Ubuntu 20.04
  • How to install MailCatcher On Ubuntu 22.04
  • HOW TO INSTALL MARIADB 10.3 ON CENTOS 7
  • How to Install MariaDB 10.3 on Ubuntu 20.04
  • How To Install MariaDB 10.7 on CentOS 7
  • How to Install MariaDB 10.7 on Fedora
  • How to install MariaDB 11 on Debian 10
  • How to install MariaDB 11 on Debian 9
  • How to install MariaDB 11 on Ubuntu 22.04
  • How To Install MariaDB on Debian 10
  • How To Install MariaDB on Debian 11
  • How To Install MariaDB On Ubuntu 18.04
  • How To Install MariaDB on Ubuntu 22.04
  • How to install Maven on Debian
  • How to install Maven on Ubuntu
  • How to install Minikube on CentOS 7 and 8
  • How to install Minikube on Debian
  • How to install Minikube on Fedora server
  • How to Install Minikube on Ubuntu server
  • How to install MongoDB on AlmaLinux 8
  • How to Install MongoDB on CentOS
  • How to Install MongoDB on Debian
  • How to Install MongoDB on Fedora 36/35/34
  • How to install mongodb on Ubuntu 18.10
  • How to Install MongoDB on Ubuntu 20.04
  • How to install Multicraft on Ubuntu 20.04
  • How to Install MySQL on Ubuntu 20.04
  • How to install MySQL Relational Databases on Fedora 12
  • How to Install Ncurses Library on Ubuntu 20.04
  • How to Install Neofetch on Ubuntu 20.04 LTS
  • How to Install netstat on Ubuntu 20.04 LTS
  • How to install NGINX Web Server on Debian 10
  • How to install NGINX Web Server on Debian 12
  • How to Install Node.js and npm on Ubuntu 20.04
  • How To Install Node.js on CentOS 8
  • How To Install Node.js on Ubuntu 20.04
  • How to Install Ntopng on Debian
  • How to Install Ntopng on Fedora
  • How to Install Ntopng on Ubuntu 20.04
  • How to install OwnCloud on CentOS
  • How to install OwnCloud on Debian server
  • How to install Owncloud on RHEL 8
  • How to install OwnCloud on Ubuntu server
  • How to Install PHP 7.4 in CentOS 7
  • How to install PHP 7.4 on AlmaLinux 8
  • How To Install PHP 7.4 on Debian 10
  • How to install PHP 7.4 on Debian 12
  • How to install PHP 7.4 on Fedora 34
  • How To Install PHP 7.4 on Fedora 36/35/34/33/32/31
  • How to install PHP 7.4 on Ubuntu 20.04
  • How to install PHP 8 on AlmaLinux 8
  • How to Install PHP 8 on Centos 7
  • How to Install PHP 8 on Debian 10
  • How to Install PHP 8 on Debian 12
  • How to Install PHP 8 on Debian 9
  • How to install PHP 8 on Fedora 38
  • How to Install PHP 8 on Ubuntu 20.04
  • How to Install PHP 8 on Ubuntu 22.04
  • How To Install PHP 8.0 on Fedora 32
  • How To Install PHP 8.0 on Fedora 33
  • How To Install PHP 8.0 on Fedora 34
  • How To Install PHP 8.0 on Fedora 35
  • How To Install PHP 8.0 on Fedora 36
  • How to install PHP 8.1 on Ubuntu 22.04
  • How to install PHP 8.2 on Ubuntu 22.04
  • How to Install PHP in CentOS 7
  • How to install PHP on CentOS 7
  • How to install PHP on Ubuntu 18.04
  • How to install phpMyAdmin on CentOS
  • How to install phpMyAdmin on Linux
  • How to Install Podman on Ubuntu 20.04 LTS
  • HOW TO INSTALL POSTGRES DATABASE IN CENTOS 7
  • How to Install PostgreSQL 15 on Ubuntu 22.04
  • How to install Postman on Centos 7
  • How to install Postman on Debian
  • How to install Postman on Debian 12
  • How to install Postman on Fedora
  • How to install Postman on Ubuntu 20.04
  • How to install Python on Ubuntu 22.04
  • How to install R on Ubuntu 22.04
  • How to install Red5 Server on Ubuntu 22.04
  • How to install Redis on CentOS
  • How to install Redis on Debian
  • How to install Redis on Fedora
  • How to install Redis on Ubuntu
  • How to install Rkhunter on Ubuntu 22.04
  • How to install Shellinabox on Debian server
  • How to install Shellinabox on Fedora
  • How to install Snap on AlmaLinux
  • How to install SNAP on Debian 10
  • How to install Snap on Fedora
  • How to install Snap on RockyLinux
  • How to Install Spack on Ubuntu 20.04
  • How to install squid proxy on Ubuntu server
  • How to Install Squid Proxy Server on CentOS
  • How to install SSL on CentOS-7.3 with httpd server
  • How to install SSL on Centos-7.3 with Nginx server
  • How to install SSL on Ubuntu with Apache2
  • How to install SSL through Cpanel .
  • How to Install Streamlit on Ubuntu 20.04
  • How to install Streamlit on Ubuntu 22.04
  • How to install tcpping on AlmaLinux
  • How to install tcpping on CentOS
  • How to install tcpping on Debian
  • How to install tcpping on Fedora
  • How to install tcpping on Ubuntu
  • How To Install the Latest MySQL on Debian 10
  • How to Install the OpenGL Library on Ubuntu 20.04
  • How to Install TinyCP on Debian
  • How to Install TinyCP on Debian 12
  • How to Install TinyCP on Ubuntu 20.04
  • How to Install TinyCP on Ubuntu 22.04
  • How to install Tomcat 10 on Ubuntu server
  • How to Install Vagrant on Ubuntu 20.04 LTS
  • How to install Vagrant on Ubuntu 22.04
  • How to Install Varnish Cache with Apache on CentOS 7
  • How to install Visual Studio Code on Debian 10
  • How to install Visual Studio Code on Ubuntu 22.04
  • How to install VnStat Network Monitoring on CentOS 7
  • How to install Webmin on AlmaLinux 8
  • How to install Webmin on Centos 7
  • How to install Webmin on Debian
  • How to install Webmin on Debian 12
  • How to install Webmin on Fedora
  • How to install Webmin on Ubuntu 20.04
  • How to Install Webuzo
  • How to Install Webuzo on Debian
  • How to Install Webuzo on Fedora
  • How to Install Webuzo v3 on Ubuntu 20.04
  • How to Install Wekan on Debian 10
  • How to Install Wekan on Debian 12
  • How to Install Wekan on Ubuntu 20.04
  • How to install Wine on Alma Linux
  • How to install Wine on RockyLinux 8
  • How to Install Wine on Ubuntu 20.04
  • How to Install wmclock on Ubuntu 20.04
  • How to install Wordpress with LEMP on CentOS server
  • How to Install WordPress with LEMP on Ubuntu
  • How to Install Xrdp Server (Remote Desktop) on Ubuntu 20.04
  • How to Install Xrdp Server on Ubuntu 22.04
  • How to install Zabbix 4.4 in CentOS 7
  • How To Install Zabbix Agent On Centos 7
  • How to install Zimbra on Ubuntu 20.04 LTS
  • How to Locate Files That Have SUID and SGID Permissions
  • How to Make a Large File in Linux
  • How to Make a Linux User Change Their Password Upon Login?
  • How To Migrate a MySQL Database Between Two Servers
  • How to migrate from CentOS 8 to Arch Linux 8.7
  • How to Mount Disk in Linux
  • How To Move a PostgreSQL Data Directory to a New Location on Ubuntu 22.04
  • How To Partition and Format Storage Devices in Linux
  • How to prevent a user from login in Linux
  • How to Prevent File and Directories from Being Deleted, Even by Root
  • How to Protect your Web Sites by using Username and password in Apache on CentOS.
  • How to Protect your Web Sites by using Username and password in Apache on Ubuntu.
  • How to Real-Time Monitor TCP and UDP Ports
  • How to Recognize Active Directories Using Shell Variables and Characters
  • How to remove FTP account in plesk
  • How to reset forgotten root password in centos 7/8
  • How to reset forgotten root password in Debian
  • How to reset forgotten root Password in Fedora 34.
  • How to reset forgotten root password in ubuntu 16/18
  • How to reset the MySQL root password in CentOS 7
  • How To Reset Your MySQL or MariaDB Root Password on Ubuntu 18.04
  • How to run different websites with different versions of PHP
  • How to Save a Command Output to a File in Linux
  • How to Schedule an Activity at a Specific Time or at a Time in the Future Using the 'at' Command
  • How to schedule your task using crontab
  • How to send an E-mail from CentOS 7

How to Set Manual or static IP Address on CentOS

  • How to Set Manual or static IP Address on Debian server
  • How to Set Manual or static IP Address on Fedora
  • How to Set Manual or static IP Address on Ubuntu server
  • How To Set or Change Timezone on Ubuntu 20.04
  • How to set up a node.js application with apache on CentOS7
  • How to Set Up SSH Keys on Ubuntu 20.04
  • How to Setup and Configure FirewallD on CentOS 7
  • How to Setup Flatpak on Ubuntu 20.04
  • HOW TO SETUP LOAD BALANCER FOR APPLICATIONS RUNNING ON CUSTOM PORT
  • How to Setup NFS server on CentOS
  • How to setup Rsyslog server on Ubuntu 22.04
  • How to Setup SFTP User Account on Fedora
  • How to Setup SFTP User Account on Ubuntu 20.04
  • How to Setup SFTP-only User Account on CentOS 7
  • How to setup SSH Tunneling or port forwarding in Linux
  • How to solve "Cannot connect to CWP Admin Panel"
  • How to solve Zimbra error "message does not meet IPv6 sending guidelines regarding PTR"
  • How to Start, Stop, and Restart MySQL Server on centos 7
  • How to Switch (su) to a Different User Account Without a Password
  • How to Test Internet Speed on Almalinux 8
  • How to test internet speed on Debian 10
  • How to test internet speed on Debian 12
  • How to Test Internet Speed on Fedora
  • How to Test Internet Speed on Ubuntu 20.04
  • How to Troubleshoot with nmap in centos
  • How to Update or Upgrade CentOS 7.1, 7.2, 7.3, 7.4, 7.5, or 7.6 to CentOS 7.7
  • How to upgrade mysql 5.7 to 8.0 in Ubuntu 16.04
  • How to use 'chage' command in Linux
  • How to use 'ps' command in Linux
  • How to Use ‘at’ Command to Schedule a Task in Linux
  • How to Use Iperf to Test Network Performance
  • How to use IPTABLES firewall in Linux
  • How to use lsyncd to sync directories on Centos
  • How to use MTR command in Linux
  • How To Use Nmap to Scan for Open Ports
  • How To Use ps, kill, and nice to Manage Processes in Linux
  • How To Use Rsync to Sync Local and Remote Directories
  • How to Use the SMTP Server of Google
  • How to Verify Your Application is Listening on the Correct Port
  • How To View and Update the Linux PATH Environment Variable
  • How to View Colored Man Page Documentation in Linux
  • How-to-set-up-a-node-js-application with apache on-centos-7
  • Install Apache 2 Web Server in CentOS 5
  • Install IBM HTTP server in Linux
  • Install IBM Websphere Application Server ( IBM WAS) in Linux
  • Install multiple version of PHP on Ubuntu server
  • Install Plesk on CentOS 7
  • Install SSL on Ubuntu server using Nginx
  • Install WHM/Cpanel in Centos 7
  • INSTALLATION AND CONFIGURATION OF APACHE TOMCAT 9 ON CENTOS 7
  • Installing MongoDB on CentOS 7
  • Installing PostgreSQL on Ubuntu 20.04: Step-by-Step Instructions
  • Introduction to rsync
  • Learning the Linux Alias Command and How to Use It
  • Linux port test commands(RedHat 7, CentOS 7, and Ubuntu 18.04)
  • Linux Top Command
  • Linux: How to Execute a Command with a Time Limit or Timeout
  • Logical volume manager in linux (LVM) Guide for beginners
  • MariaDB installation on CentOS 8
  • Methods for Disabling the Root Account in Linux
  • Migrate your Google Cloud Platform to Microhost Cloud
  • Modify File Permissions with chmod
  • Most Common Network Port Numbers for Linux
  • Multiple User Account Creation in Linux
  • Mysql 1030 got error 28 from storage engine
  • MySQL Relational Databases on Ubuntu 12.04
  • Nginx and PHP-FastCGI in Arch Linux
  • NGINX Installation in CentOS 7
  • NTP Server Configuration
  • Python 3 Installation and Programming Environment Configuration on an Ubuntu 22.04
  • Recover forgotten password of admin user in Jenkins
  • Set a date and time for each command in Bash History. 
  • Setup Software RAID on Linux server
  • Speed Test in Ubuntu server
  • SSH and SCP command in Linux
  • SSH Logins with Banner Messages (Issue.net)
  • SSH Logins with Banner Messages (MOTD File)
  • Structure Of Apache Configuration
  • The 'cat' and 'tac' Commands in Linux: A Step-by-Step Guide with Examples
  • Update DNS records For A Domain Using Plesk
  • Update PHP 5.4 version to PHP 7.4
  • Upgrading WordPress Manually on Linux sever
  • URLs Redirect with Apache Web Server
  • User Group and File permission in Linux
  • Using Fedora 20 MySQL Relational Databases
  • Using mysqldump to Backup MySQL Databases
  • Using the Carat () Symbol, you can easily correct a previous command's typo. 
  • Using the Terminal in Linux to Examine the Website's Loading Time
  • Using the yum command, install Google Chrome on CentOS 7.
  • VirtualHost creation in Tomcat 10/9/8/7
  • What are Runlevels in Linux and its understanding
  • What is Hugo and How to use it
  • What is IAAS, PAAS and SAAS
  • What is IOSTAT command and how to use it
  • Why less is Faster Than more Command for Effective File Navigation
  • Show all Docs ( 457 ) Collapse Docs
  • How to create user and give limited permission to the host in Zabbix
  • Deploy a new server with snapshot
  • DNS Management
  • How to access a server through password-less authentication
  • How to add additional storage in the Microhost Cloud Server
  • How to check Bandwidth consumption in Microhost panel
  • How to create Microhost cloud server
  • How to deploy a cloud server with custom ISO
  • How to destroy MicroHost cloud server
  • How to enable weekly backup in Microhost Cloud server
  • How to install Wine on RHEL 8
  • How to rebuild Microhost Cloud Server
  • How to resize (upgrade/downgrade) cloud server.
  • How to take snapshot of a Cloud Server
  • Microhost Cloud Firewall
  • Steps to Activate Microhost VPN
  • Show all Docs ( 1 ) Collapse Docs

Web Servers

  • How to Configure NGINX
  • How to install NGINX in Ubuntu 18.04 LTS
  • Install and configure Nginx and PHP-FastCGI in Ubuntu 16.04
  • NGINX : Enable TLS or HTTPS Connections
  • NGINX: Installation and Basic Setup
  • Use NGINX as a Reverse Proxy
  • What is NGINX?
  • Apache Virtual Hosts setup on CentOS 7
  • Basics Information of Apache Configuration
  • CHANGE AND UPDATE PASSWORD OF CPANEL ACCOUNT
  • How to add A record in Plesk
  • How to add CNAME record in Plesk
  • How to add components in Plesk
  • How to add MX record in Plesk
  • How to add TXT record in Plesk
  • How to assign permissions to Files and Folders in Plesk
  • How to change NGINX port in Linux
  • How to change PHP parameter manually through Plesk
  • How to change the PHP version on Plesk
  • How to change your Plesk password
  • How to check current Disk Space in Plesk
  • How to Configure ModSecurity in Apache
  • How to configure MX record in MAILENABLE
  • How to create a backup in Plesk
  • How to create a MySQL/MariaDB Database and Database User in Plesk
  • How to create a user role in Plesk
  • How To Create an Account in CPanel with WHM
  • How To create and connect an FTP Account in cPanel
  • How to delete an Email account in Plesk
  • How to do Server-wide blacklist in Plesk
  • How to do Server-wide whitelist in Plesk
  • How to enable IonCube Loader in Plesk
  • How to Export and Import Database Dumps in Plesk
  • How to install Joomla in Plesk
  • How to Install NGINX Web Server on Ubuntu 22.04 LTS
  • How to install WordPress in Plesk
  • How to manage user roles in Plesk
  • How to migrate accounts from CWP to CWP
  • How to modify Database user privileges in Plesk
  • How to remove components in Plesk
  • How to Set Up the .htaccess File in Apache
  • How to setup scheduled tasks in Plesk
  • How to Solve "The server requested authentication method unknown to the client" in phpMyAdmin
  • How to Start, Stop or Restart System Services in Plesk
  • Installation of LAMP Stack on Ubuntu 16
  • Managing Resources using Apache mod_alias
  • Rewrite URLs using mod_rewrite and Apache
  • Rule-based Access Control for Apache
  • Tuning Of Your Apache Server
  • Show all Docs ( 43 ) Collapse Docs
  • How to add SSL biniding in windows server
  • How to allocate unallocated disk space in Windows Server
  • How to allow ICMPv4(PING) in Windows Firewall using PowerShell
  • How to allow multiple RDP sessions for the single user in Windows Server
  • How to Block or Allow TCP/IP Port in Windows Firewall
  • How to Boot Windows Server into Safe Mode
  • How to change default shell from cmd to PowerShell in Windows Server
  • How to change RDP port in Windows Server
  • How to change RDP port via PowerShell in Windows server
  • How to configure a DNS Reverse Lookup Zone in Windows Server 2019
  • How to Configure FTP Server on Windows Server 2019
  • How to configure IP manually on Windows Server
  • How to connect SFTP using FileZilla
  • How to connect to a Windows server using Remote Desktop Protocol (RDP)
  • How to Connect Virtual Server Remotely Using RDP in Windows OS
  • How to Create Mailbox in MailEnable
  • How to create RDP user in Windows Server 2012
  • How to host a domain on Windows Server 2019
  • How to Initialize and bring a disk online in Window Server
  • How to Install & Configure Printer Tool in Windows Server
  • How to install Active Directory Domain Service on Windows Server
  • How to install Apache Tomcat 9 on Windows Server
  • How to install IIS via Powershell in Windows Server
  • How to install Java Development kit on Windows Server
  • HOW TO INSTALL MAILENABLE ON WINDOWS SERVER
  • How to install MsSQL Express Edition 2019 on Windows Server
  • How to Install MultiPoint Services in Windows Server 2016
  • How to install MySQL on Windows Server 2019
  • HOW TO INSTALL ONE SSL CERTIFICATE ON TWO DIFFERENT WINDOWS SERVER
  • How to Install OpenSSH on Windows Server
  • How to install Python 3.7 on Windows Server 2012 R2, 2016, 2019, 2022 via PowerShell
  • How to install SSL in Apache Tomcat in Windows Server
  • How to Install SSL on Windows Server
  • How to install Telnet Client on a server using Windows PowerShell
  • How to Install Windows RDP CAL license in windows servers
  • How to install Wordpress on IIS in WIndows Server 2019
  • How to install XAMPP on Windows Server 2016/2019/2022
  • How to make partition from existing drive Windows Server
  • HOW TO MIGRATE THE ZIMBRA EMAILS ON PLESK PANEL USING EMAIL MIGRATOR
  • How to mount NFS persistently in Windows Server
  • How to mount Virtio ISO
  • How To open a port in Windows Server Firewall
  • How to reset a lost Administrator password in Windows Server
  • How to setup Disk Driver while deploying Windows Server with custom ISO
  • How to setup Network Driver while deploying Windows Server with custom ISO
  • How to setup NTP Client for time synchronization using PowerShell 
  • How to setup NTP Server for time synchronization using Powershell
  • How to Setup OpenVPN Connect in Windows Server
  • How to setup SSH Server on Windows Server via PowerShell
  • How to share a folder over network in Windows Servers
  • How to solve internal server error while connecting to RDP
  • How to Turn off Internet Explorer Enhanced Security Configuration on Windows Server
  • How to upgrade TLS 1.1 to TLS 1.2 in window server
  • How to upgrade Windows Server 2012R2 to Windows Server 2016
  • How to use telnet, netstat and wireshark in Windows
  • Install Plesk on Windows Server 2012
  • Install SQL Server 2012 Express Edition in Windows Server 2012
  • Installation and Configuration of IIS Web Server on Windows Server
  • Mssql database backup restore script
  • Windows Server Backup feature (2012R2, 2016, 2019)
  • Show all Docs ( 47 ) Collapse Docs

How to Set Manual or static IP Address on CentOS server

In this article we will discuss How to Set Manual or static IP Address on CentOS,

There will come a moment in your career as a Linux system administrator when you will be tasked with the responsibility of configuring networking on your machine. On desktop computers, you are able to utilise dynamic IP addresses; but, in order to set up a server architecture, you will need to configure a static IP address (at least in most cases).

The following information on Internet Protocol version 4 (IPv4) will be used so that we may accomplish the objectives of this tutorial.

To configure static IP address, open the /etc/sysconfig/network-scripts/ifcfg-eth0

Note : The filename ifcfg-eth may varies from CentOS to Redhat linux. In CentOS it is available named as ifcfg-eth0, whereas it will be available only as eth0. Also, the file name will be depend on your device name available on your Linux machines such as ens0 or so on.

[console]# vi /etc/sysconfig/network-scripts/ifcfg-eth0 [/console]

DEVICE="eth0" HWADDR="00:08:a2:0a:ba:b8" BOOTPROTO=dhcp ONBOOT=yes UUID="41171a6f-bce1-44de-8a6e-cf5e782f8bd6" IPV6INIT=yes TYPE=Ethernet NAME="eth0"

Now make changes like shown below, please do not forget to make changes according to your need

DEVICE=eth0 HWADDR=00:16:3e:65:de:88 BOOTPROTO=static ONBOOT=yes NM_CONTROLLED=no IPADDR= 192.168.1.10 NETMASK=255.255.255.0 GATEWAY= 192.168.1.1 DNS1=8.8.8.8 DNS2= 4.4. 4 4

Please note that, You only need to change the following points.

The rest of the entries should be left unchanged.

Next edit  resolve.conf to change or update the DNS nameserver

[console]# vi /etc/resolv.conf [/console]

nameserver 8.8.8.8 nameserver 8.8.4.4

Once you have made your changes restart the networking manager service with:

[console]# systemctl restart NetworkManager [/console]

or you can just down and up the network interface using the below command

[console]# ifdown eth0 # ifup eth0[/console]

Now to check the configured ip on your machine, run the below command

[console]# ifconfig [/console]

how to assign static ip on centos 7

  • manual ip on centos
  • Set Manual or static IP Address

DEV Community

DEV Community

Paula

Posted on Mar 27, 2023

How to configure a static IP address on CentOS 7 with VirtualBox

This article aims to explain how to configure a static IP address on a CentOS 7 virtual machine using VirtualBox.

We will go step by step, and at the end of this blog, you will be able to ssh into your virtual machine using a never-changing IP.

What is a static IP?

Every computer has a random local IP address unless you have specified the contrary. These addresses are not fixed. It means that they could change.

In most cases, you don’t care about the IP address, but you usually do with virtual machines.

If you have a MySQL service running on a virtual machine, you would want to save the connection configuration once and re-use it every time. If the IP address changes, you have to modify the connection settings.

Another approach is to use port-forwarding. This approach is okay until you have 3 or more virtual machines with multiple services and ports to keep track of.

The following image shows the ideal local development environment with static IP addresses.

Image description

Configure VirtualBox Networking

The app VirtualBox has some networking settings we have to set before changing the VM Linux configuration.

We want our VM to have the following:

  • Access to the internet
  • Access to our host computer

And we also want to be able to access the VM by IP.

Step 1: Stop the VM

You have to stop the VM before doing the following steps.

Step 2: Create Ethernet Adapter

Click on Tools - Networks and make sure you have an ethernet adapter created. Write down the IPv4 Prefix, because the static IP will be in this range.

Image description

In the image above:

  • The gateway is 192.168.56.1
  • The network mask is 255.255.255.0 (24 bits)

The static IP of my VM will be in the 192.168.56.xx range.

Step 3: Change adapters

Right-click on the virtual machine and choose the “Network” tab. We are going to add 2 adapters:

  • The first one is going to be a NAT. This way the VM will have internet access.
  • The second one has to be a “Host-only Adapter” with the ethernet adapter of the previous step. This is the adapter that will have the static IP assigned.

Image description

Configure VM Centos 7

Now that we have configured the VirtualBox networking, we will configure the inner VM networking settings.

Step 1: Start the VM

Double-click on the VM or right-click and start.

Step 2: Get the connection name

We know the static IP will be assigned to the second adapter, the Host-only Adapter.

Let’s check the vm networking using ip addr | head -n 20 :

Image description

  • enp0s3: NAT Adapter
  • enp0s8: Host-Only Adapter

Now we know we have to assign an IP to the enp0s8 device. To get its connection name, you have to execute the following statement:

nmcli -p device

Image description

The connection name is “Ethernet connection 1”.

Step 3: Configure connection IP

There are two ways of doing it:

  • Graphically with nmtui
  • With bash statements and nmcli

In our case, we will execute some statements in the console.

If we execute ip addr | head -n 20 again, we will see the previous IP address.

Image description

Step 4: Reboot

The last step is to reboot the VM

Test the connection

Now we can connect to the VM using the command ssh [email protected]

Top comments (0)

pic

Templates let you quickly answer FAQs or store snippets for re-use.

Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink .

Hide child comments as well

For further actions, you may consider blocking this person and/or reporting abuse

kacperlukawski profile image

What is Hybrid Search?

Kacper Łukawski - Feb 6

surajondev profile image

GitHub Security Best Practices Every Developer Should Know

Suraj Vishwakarma - Feb 22

adhikareeprayush profile image

The Ultimate Roadmap to a Full-Stack Developer

Prayush Adhikari - Feb 22

ghostaram profile image

How to set and customize horizontal and vertical scrollbars with CSS

Felix Owino - Feb 7

Once suspended, pauladj will not be able to comment or publish posts until their suspension is removed.

Once unsuspended, pauladj will be able to comment and publish posts again.

Once unpublished, all posts by pauladj will become hidden and only accessible to themselves.

If pauladj is not suspended, they can still re-publish their posts from their dashboard.

Once unpublished, this post will become invisible to the public and only accessible to Paula.

They can still re-publish the post if they are not suspended.

Thanks for keeping DEV Community safe. Here is what you can do to flag pauladj:

pauladj consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy.

Unflagging pauladj will restore default visibility to their posts.

DEV Community

We're a place where coders share, stay up-to-date and grow their careers.

XDA Developers

How to set a static internal IP in Ubuntu

Quick links, how to set static internal ip in ubuntu using the gui, how to set static internal ip in ubuntu using the terminal and text editor.

There comes a time when you might have to configure Ubuntu or any other Linux distribution with a static IP address. While you can't change your external static IP address, since it's the one your internet service provider provides, you can change your internal one. This is the IP address used on your network inside your home or office.

Though many tasks on Ubuntu usually require you to visit the terminal app and deal with lines of text, changing your internal IP is easy. You can do this through the settings app and the Graphical User Interface (GUI). Of course, if you want, you can also swap things out by going through the terminal. Here's how.

Without any technical know-how or knowledge, you can set a static IP in Ubuntu through the settings app. Just note, you will have to use the terminal once to find a range of IP addresses that you can assign. Once you do that, you just tap the Windows Key or the Superkey on your device and search for Settings . Once the app is open, proceed with the steps below.

  • If you're connected to the internet via Wi-Fi, choose Wi-Fi . If you're connected via Ethernet, select Network.
  • Once the interface is open, click the settings icon next to the network you're connected to.
  • From the list of tabs at the top, choose IPv4.
  • Under ipv4 method, be sure to choose Manual.
  • Under Addresses, enter the IP address, the Netmask, and the Gateway you want to use. For finding IP addresses that'll work on your network, you can proceed with the steps below.
  • Open a terminal session. With Ctrl, Alt, and T. Install net-tools with the command sudo apt install net-tools.
  • In this case, we have an inet of 192.168.1.176 and a netmask of 255.255.255.0. We can enter those numbers and can calculate the usable range using this website .
  • When you've calculated the usable range of addresses, choose a valid IP address that falls within this range. Then, you can click Apply at the top.

Any changes you apply will automatically go into effect. If you want, you can also use the terminal to confirm your IP address. Launch it with Ctrl, Alt, and T on your keyboard. Once launched, enter the command ip addr or ip a . You should see an interface IP address listed.

If you're a bit more technical and want to set a static IP in Ubuntu using the terminal, that is possible. You'll have to edit some lines of text and go through a few extra steps, but here's how:

  • Display information about your network. Use the command nmcli connection show. You'll see a network name, a UUID, a Type, and a Device. If this package isn't installed (though it should be, as it comes preinstalled with Ubuntu), then run sudo apt-get install network-manager
  • Note down the range of IP addresses you'll be able to use. Use the command ip addr to find out your machine's current IP address. This tutorial assumes that your network adapter is called enp0s3. If it isn't, then look for the correct one and also change the interface names in the subsequent commands. In the above example, we have an inet of 10.0.2.15, with the /24 denoting that the network uses a 255.255.255.0 subnet mask. In most cases, your usable network range will be whatever is in the first three places of the internal IP address, and then any unused number on your network between 1 and 255 in the last section. For example, we can use 10.0.2.16. If you're unsure, you can enter the subnet mask and your internal IP address into this website to calculate the usable range.
  • Note the IP address of your default gateway with the command ip r. In our example, it's 10.2.2.2.
  • Next, we'll add a new static connection option. Run the following command, making sure to change the numbers after "ip4" and "gw4" depending on your network conditions. These are the IP address you want to change your machine to and the current default gateway, respectively. sudo nmcli con add con-name "static" ifname enp0s3 type ethernet ip4 10.0.2.13/24 gw4 10.0.2.2 In our case, we do the following.
  • Set your DNS, manual DHCP (so, a static IP), and enable the connection. You can do that by running the following commands in succession. nmcli con mod "static" ipv4.dns "1.1.1.1,8.8.8.8" You can swap out the DNS servers above for whatever you want, they are in order of primary and secondary. nmcli con mod "static" ipv4.method manual; nmcli con up "static" ifname enp0s3 Once done, you can run nmcli con show to see if the new connection is enabled. If the output above looks like yours, then you're ready to go!

Setting complete

That's all you need to set up a static IP in Ubuntu. It doesn't take much effort. Remember, we're always writing about Linux, so you can check out our guide to the best Linux laptops should you need one.

How to set a static internal IP in Ubuntu

IMAGES

  1. How to configure a static IP address on CentOS 7 / RHEL 7

    how to assign static ip on centos 7

  2. Configure centos 7 static ip

    how to assign static ip on centos 7

  3. How to setup a static IP address on Centos 7 / RHEL 7

    how to assign static ip on centos 7

  4. How to configure a static IP address in CentOS 7

    how to assign static ip on centos 7

  5. How to assign Static IP Address in CentOS 7.3

    how to assign static ip on centos 7

  6. How To Configure Static IP Address On CentOS 7 » TechnologyRSS

    how to assign static ip on centos 7

VIDEO

  1. How to Assign Static IP Address to Raspberry Pi- Step by Step Guide!

  2. How to set multiple IP to one single network interface in Fedora or CentOS system

  3. Configure static IP address on CentOS 7

  4. How to Assign a Static IP Address in Windows 11

  5. How to assign IP address to Kyocera TASKalfa Printer

  6. 14 CentOS 7 Hostname

COMMENTS

  1. How to configure a static IP address on CentOS 7 / RHEL 7

    In this quick tutorial you will learn about configuring a network interface with a static IP address using ifcfg files located in /etc/sysconfig/network-scripts/ directory in a CentOS 7 and RHEL 7: nixCraft: Privacy First, Reader Supported nixCraft is a one-person operation. I create all the content myself, with no help from AI or ML.

  2. How to configure a static IP address in CentOS 7

    Find your interface The first thing we must do is find out the name of our ethernet interface. A static IP address cannot be configured without this name. To do this, log into your server and...

  3. How To Configure Static IP Address in CentOS 7 / RHEL 7

    Method 1 In this method, we will edit the network interface file found under /etc/sysconfig/network-scripts/ directory. For interface enp0s3, the file name would be ifcfg-enp0s3. vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 Update the interface file as per the requirement.

  4. Configure Static IP Address on CentOS 8|CentOS 7

    To configure static IP address on CentOS, you can use any of the following methods: Directing editing network configuration file under /etc/sysconfig/network-scripts/ directory. Using nmcli network configuration command line tool Using nmtui network configuration tool Making static IP address configuration using ip and ifconfig commands.

  5. How to Configure Network Static IP Address on RHEL/CentOS 8/7

    Step 1: Disable Unwanted System Services in CentOS 1. Before actually starting to do anything we need to make sure that our system has some necessary editing and networking tools like netstat, ifconfig, wget, curl, and lsof installed, some of them will not be used on this step but it's better to have them installed for future configurations.

  6. How can I set a static IP address in CentOS 7?

    I have a CentOS 7 Minimal VirtualBox VM that I would like to set a static IP address on. I want to assign the static IP address via a Bash script within the VM (so not using the VirtualBox network . Stack Exchange Network.

  7. How to configure a static IP address on CentOS 7

    If you want to set up a static IP address on a network interface in CentOS 7, there are several different ways to do it, varying depending on whether or not you want to use Network Manager for that.

  8. How To Configure Static IP On CentOS 7

    Question: How to switch from Dynamic to static in my CentOS 7? Answer: Before to convert from dynmic to static, please make an copy of resolv.conf under etc folder. cp /etc/resolv.conf /etc/resolv.conf.backup 1 - Please edit "/etc/sysconfig/network-scripts/ifcfg-enp0s3".

  9. How to Configure a Static IP address on CentOS/RHEL 7

    Sample Example Below are basic configuration instructions to setup a static IP address on CentOS/RHEL 7. 1. First, list your network interfaces with ip command: # ip add show Make a note of network interface you would like to set with static IP address. 2. Next, locate a corresponding script to the network interface name.

  10. Static IP Configuration on CentOS 7

    How to configure Static IP Configuration on CentOS 7? Network configuration on CentOS 7 is made automatic and simple through the use of Network Manager. It manages network interfaces like Ethernet, WiFi, and Mobile Broadband devices, in addition to the primary network connection.

  11. How to Assign a Static IP for a CentOS 7 or RHEL 7

    Setting a static IP address may be required in different situations, such as configuring port forwarding or running a web server behind a NAT. This post explains how to set up a static IP address on a CentOS 7/RHEL 7 server.

  12. How to Set a Static IP Address in CentOS Linux

    Set IP Address in CentOS. Save and exit the file. Restart the networking service with the following commands: # nmcli networking off # nmcli networking on Finally, run 'ifconfig' again to verify if static IP has been set. # ifconfig Verify IP Address in CentOS Conclusion. In this article, we saw an easy way to set an IP address in CentOS.

  13. How To Configure a Static IP Address on CentOS 7/8

    Introduction This guide details howto configure a static IP on CentOS 7 or 8 on an operating system installed without a GUI. There are a number of options/methods available to do this outlined below. Method 1 - Using Network Configuration File 1) First determinte the name of your network adapter by running the following:

  14. Easy guide to assign Static IP Address on CentOS / RHEL (7 & 8)

    So what do we do? We need to manually assign a static IP address to our servers. In this tutorial, we will learn how to assign static IP addresses in CentOS 7 or 8 machines. There are two ways we can assign a static IP address in CentOS 8 systems, 1- Using Network manager 2- Assigning IP using network files

  15. How to configure static ip address on CentOS 7

    In this small tutorial i will explain how to configure static ip address on CentOS 7 minimal. First, need to edit the set up for the ethernet.

  16. How to configure a static IP address on CentOS 7 / RHEL 7

    August 15, 2016 On CentOS 7 or RHEL 7 one need to use the NetworkManager daemon. It attempts to make networking configuration and operation as painless and automatic as possible by managing the primary network connection and other network interfaces, like Ethernet, WiFi, and Mobile Broadband devices.

  17. How to setup a static IP address on Centos 7 / RHEL 7

    How To Configure Static IP On CentOS 7 ?To Setup a static Ip address on CentOS ,it's really easy, we are going through the process of setting up a static ip Address. ... In this article we will explain how to setup a static IP address on Centos 7 / RHEL 7.There are several ways to configure a static IP address. 1. nmtui Tool ( Network ...

  18. bash

    Please follow the following steps to assign static IP in CentOs7 vim /etc/sysconfig/network-scripts/ifcfg-eth0

  19. CentOS 7 Tutorial: static IP Address CentOS 7

    This video describes the process involved in statically assigning an IP Address in Linux (Centos 7)You will learn how to assign a static IP address on CentOs...

  20. Easy guide to assign Static IP Address on CentOS / RHEL (7 & 8)

    So what do we do? We need to manually assign a static IP address to our servers. In this tutorial, we will learn how to assign static IP addresses in CentOS 7 or 8 machines. There...

  21. How to Set Manual or static IP Address on CentOS

    On desktop computers, you are able to utilise dynamic IP addresses; but, in order to set up a server architecture, you will need to configure a static IP address (at least in most cases). The following information on Internet Protocol version 4 (IPv4) will be used so that we may accomplish the objectives of this tutorial.

  22. How to configure a static IP address on CentOS 7 with VirtualBox

    Step 1: Stop the VM You have to stop the VM before doing the following steps. Step 2: Create Ethernet Adapter Click on Tools - Networks and make sure you have an ethernet adapter created. Write down the IPv4 Prefix, because the static IP will be in this range. In the image above: The gateway is 192.168.56.1

  23. How to Configure Static IP in CentOS 7

    In this tutorial, we will go through two methods to configure the static IP address on CentOS 7. ... Install DNS (Bind) on CentOS 7 By: Mery / 1 January, 2018. Categories Windows Server (13) Hosting Control Panles (3) Dedicated Servers (12) Linux Tutorial (135) General (115) wordpress (2)

  24. How to set a static internal IP in Ubuntu

    If you're connected to the internet via Wi-Fi, choose Wi-Fi.If you're connected via Ethernet, select Network.; Once the interface is open, click the settings icon next to the network you're ...