how to set static IP on CentOS 7.5 +

Posted by

Trying to install de QRadar CE (community edition) in my home lab I found a pre-requisite, “static IP” so let’s check the steps I used to configure it.

1. Internet adapter

To know the internet adapter just do an [ifconfig], example:

Screen Shot 2019-07-13 at 18.00.28
ifconfig info

There you will see two options, “enp0s3″ and “lo“, specifically “inet” will show you the IP address, Netmask and Broadcast. So, there you can confirm the adapter the device is using is [enp0s3].

Note: if the command “ipconfig” is not working, “command not found” check this post.

2. Locate the adapter file configuration

[root@tonk~]# locate enp0s3

3. Do a backup of the file

[root@tonk~]# cp /etc/sysconfig/network-scripts/ifcfg-enp0s3 /etc/sysconfig/network-scripts/ifcfg-enp0s3.bk

4. Edit the file and add the following lines, “you need to know the ip address, netmask and gateway”

[root@tonk~]# cat /etc/sysconfig/network-scripts/ifcfg-enp0s3

5. Restart network service

[root@tonk~]# systemctl restart network

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s