{"id":5402,"date":"2014-09-08T00:49:59","date_gmt":"2014-09-07T16:49:59","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=5402"},"modified":"2023-04-28T09:48:16","modified_gmt":"2023-04-28T09:48:16","slug":"how-to-configure-static-ip-address-on-rhel-7-0centos-7-0","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/how-to-configure-static-ip-address-on-rhel-7-0centos-7-0\/","title":{"rendered":"How to Configure Static IP Address on RHEL 7.0\/CentOS 7.0\/Oracle Linux 7"},"content":{"rendered":"<p>This article will describe the procedure to configure static Ip address on RHEL 7\/CentOS 7\/Oracle Linux 7 minimal installation. Network interface configuration files control the software interfaces for individual network devices. As the system boots, it uses these files to determine what interfaces to bring up and how to configure them. These files are usually named ifcfg-name. Since the release of RHEL 7, redhat come with the <a href=\"https:\/\/webhostinggeeks.com\/howto\/new-naming-scheme-for-the-network-interface-on-rhel-7centos-7\/\">new naming scheme<\/a> for the network devices. In RHEL7\/CentOS7\/Oracle Linux 7, the default network interface name is based on firmware, topology, and location information. In this procedure, the network interface name is ifcfg-ens160.<\/p>\n<p>1. Original ip configuration :<\/p>\n<pre>\n# cat \/etc\/sysconfig\/network-scripts\/ifcfg-ens160\nHWADDR=00:02:22:G4:EE:FF\nTYPE=Ethernet\nBOOTPROTO=dhcp\nDEFROUTE=yes\nPEERDNS=yes\nPEERROUTES=yes\nIPV4_FAILURE_FATAL=no\nIPV6INIT=yes\nIPV6_AUTOCONF=yes\nIPV6_DEFROUTE=yes\nIPV6_PEERDNS=yes\nIPV6_PEERROUTES=yes\nIPV6_FAILURE_FATAL=no\nNAME=ens160\nUUID=34796933-af4b-4a41-8287-6e57ac131234\nONBOOT=no\n<\/pre>\n<p>2. Please change <strong>BOOTPROTO<\/strong> to static or none, <strong>ONBOOT<\/strong> statement is set on YES and don\u2019t change <strong>HWADDR<\/strong> and <strong>UUID<\/strong> values provided by default. Please add IPADDR, NETMASK, GATEWAY and DNS1 line as below :<\/p>\n<pre>\nHWADDR=00:02:22:G4:EE:FF\nTYPE=Ethernet\nBOOTPROTO=none\nDEFROUTE=yes\nPEERDNS=yes\nPEERROUTES=yes\nIPV4_FAILURE_FATAL=no\nIPV6INIT=yes\nIPV6_AUTOCONF=yes\nIPV6_DEFROUTE=yes\nIPV6_PEERDNS=yes\nIPV6_PEERROUTES=yes\nIPV6_FAILURE_FATAL=no\nNAME=ens160\nUUID=34796933-af4b-4a41-8287-6e57ac131234\nONBOOT=yes\nIPADDR=192.168.0.70\nNETMASK=255.255.255.0\nGATEWAY=192.168.0.1\nDNS1=8.8.8.8\n<\/pre>\n<p>3. Restart network interface to take effect :<\/p>\n<pre>\n# systemctl restart network\n<\/pre>\n<p>or<\/p>\n<pre>\n# service network restart\nRestarting network (via systemctl):                        [  OK  ]\n<\/pre>\n<p>4. Run ifconfig to display the ip address. If your ifconfig command is not found, please follow this instruction to install it.(<a href=\"https:\/\/webhostinggeeks.com\/howto\/how-to-install-ifconfig-and-netstat-on-rhel-7-0centos-7-0\/\">How to Install ifconfig and netstat on RHEL 7.0\/CentOS 7.0<\/a>):<\/p>\n<pre>\n# ifconfig\nens160: flags=4163<up ,BROADCAST,RUNNING,MULTICAST>  mtu 1500\n        inet 192.168.0.70  netmask 255.255.255.0  broadcast 192.168.0.255\n        inet6 fe80::20c:29ff:feba:3efe  prefixlen 64  scopeid 0x20<link \/>\n        ether 00:0c:29:ba:3e:fe  txqueuelen 1000  (Ethernet)\n        RX packets 20775  bytes 1455662 (1.3 MiB)\n        RX errors 0  dropped 40  overruns 0  frame 0\n        TX packets 1289  bytes 179594 (175.3 KiB)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n\nlo: flags=73<\/up><up ,LOOPBACK,RUNNING>  mtu 65536\n        inet 127.0.0.1  netmask 255.0.0.0\n        inet6 ::1  prefixlen 128  scopeid 0x10<host>\n        loop  txqueuelen 0  (Local Loopback)\n        RX packets 8  bytes 656 (656.0 B)\n        RX errors 0  dropped 0  overruns 0  frame 0\n        TX packets 8  bytes 656 (656.0 B)\n        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0\n\n<\/host><\/up><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This article will describe the procedure to configure static Ip address on RHEL 7\/CentOS 7\/Oracle Linux 7 minimal installation. Network interface configuration files control the software interfaces for individual network&#8230;<\/p>\n","protected":false},"author":6,"featured_media":6280,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,1020],"tags":[1259,1536,1627],"class_list":["post-5402","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-oracle-linux-7","tag-centos-7-0","tag-linux","tag-oracle-linux-7"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/5402","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/users\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/comments?post=5402"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/5402\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/6280"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=5402"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=5402"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=5402"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}