How To Configure Static IP Address in RHEL 7

Configuring IP address is one of the most common tasks for a system administrator. You can use either Static or Dynamic method to configure IP address. Regardless of the methods you choose, you can configure IP address in RHEL 7 using either GUI or CLI interface. In this post, we will explain how to configure static IP address in RHEL 7 using CLI interface. For this, we will use the nmcli command line tool. Let’s configure the following IP address and other TCP/IP settings in RHEL 7 system using the nmcli command line tool.

  • Method: Static
  • Interface name: eno1777736
  • IPv4 address: 192.168.0.1/24
  • Default gateway: 192.168.0.100
  • DNS server: 192.168.0.100

You may also like:

Step To Configure Static IP Address in RHEL 7 (Linux)

In order to configure the preceding TCP/IP settings using the nmcli command in RHEL 7 system, you need to perform the following steps:

  1. First, execute the following command and verify the current TCP/IP settings.
    #nmcli con show eno1777736| grep ipv4
  2. In the following figure, you can see that currently no IP address is configured for the eno16777736 interface.Configure Static IP Address in RHEL 7
  3. Next, execute the following commands to set 192.168.0.1/24 as IP address and 192.168.0.100 as the default gateway.
    #nmcli con mod eno1777736 ipv4.addresses '192.168.0.1/24 192.168.0.100'
    #nmcli con mod eno1777736 ipv4.method manual
  4. Next, execute the following command to 192.168.0.100 as DNS server.
    #nmcli con mod eno1777736 ipv4.dns 192.168.0.100
  5. Next, execute the following commands to enable the eno1777736 interface so the changes can be reflected.
    #nmcli con up eno1777736
  6. Now, you have configured static IP address for your RHEL 7 Linux system. Next, execute the following command to view the IP address and other TCP/IP settings of your system.
    #nmcli con show eno1777736 | grep ipv4
  7. In the following figure, you can see that the appropriate TCP/IP settings are configured on your RHEL 7 system.

nmcli command tool in RHEL 7 Linux

That’s all you need to configure static IP address and other TCP/IP settings on your RHEL 7 system. Drop your queries in the comment box if you want something to say us. Do share the article.

Posted in Linux Tagged with: , ,

Leave a Reply

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

*