Jump to content

How to set a static IP in Centos 7-8|RHEL 7-8


brent
 Share

Recommended Posts

navigate to the following location.

/etc/sysconfig/network-scripts/

in this location you will find your NIC file. modify the file with your editor of choice.

BOOTPROTO=dhcp

To:

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

Save the file

restart networking

sudo systemctl restart network

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...