

Remember to change the DNS server and gateway accordingly. To change the IP Address, change the line of IPADDR=”10.40.14.200″ to your own. Sudo nano /etc/sysconfig/network-scripts/ifcfg-eth0ĭo not forget to change the ‘eth0’ to your own adapter name. We need to open this file with a text editor: Use this command to show a list of all the files in your directory:Īs you can see there is a file called ‘ ifcfg-‘.
#Centos 7 static ip address how to
Here is how to step forward: 1)DEVICEeth0 2)BOOTPROTOnone 3)ONBOOTyes 4)PREFIX24 5)IPADDR192.168.2. The first step is to create this file /etc/sysconfig/network-scripts/ifcfg-eth0. You’re now in the directory where the config file is stored. Cloud VPS or Dedicated Server with CentOS 7 installed. Now we have the name of the active adapter, we can change the configuration file of the named adapter. In the picture below it shows that number 2 ( eth0) is my active adapter. The first one is often the loopback adapter ( lo). This will show a list of the current active adapters. If necessary, you can check that the ip utility is installed by checking its version number as. You can do so by using the following command: The package name in Red Hat Enterprise Linux 7 is iproute. Listing the Network Adaptersįirst we need to check which network adapter you’re currently using.
#Centos 7 static ip address install
If you don’t have a text editor installed, you can easily do so by running ‘ sudo yum install nano‘, please make sure you have access to the internet so you can download the packages.

Setting a static IP address is a very important thing to do if you want to set-up a webserver or web-application server. Configuring a static IP address isn’t a requirement to run the OS, but it makes a lot easier to connect to the machine through remote desktop. I did it with the intention to explore this enterprise friendly Red Hat derivative and now I’d like to shere my next step. Inet 192.168.0.88/24 brd 192.168.0.This guide is created for people who want to set a static IP address on their CentOS computer or virtual machine. In my last article I explained why and how I installed CentOS in my Hyper-V lab. Now restart your network or rebooting system /etc/init.d/network restartġ: lo: mtu 65536 qdisc noqueue state UNKNOWN Now, configure default getaway: vi /etc/sysconfig/network Let’s start with editing “ /etc/sysconfig/network-scripts/ifcfg-enp0s3″ file: vi /etc/sysconfig/network-scripts/ifcfg-enp0s3 HWADDR=08:00:27:6C:FF:91

It has to be changed to static for static IP configuration. First, need to edit the set up for the ethernet. BOOTPROTO It is the protocol to be implemented during Boot time. In the example, we will configure the network.

In this small tutorial i will explain how to configure static ip address on CentOS 7 minimal. The following will introduce two ways to configure a static IP address for the network interface on CentOS 7.
