{"id":14443,"date":"2014-03-04T21:22:16","date_gmt":"2014-03-04T21:22:16","guid":{"rendered":"http:\/\/blog.shineservers.com\/?p=2434"},"modified":"2014-03-04T21:22:16","modified_gmt":"2014-03-04T21:22:16","slug":"linux-static-ip-address-configuration","status":"publish","type":"post","link":"https:\/\/www.shineservers.com\/2014\/03\/04\/linux-static-ip-address-configuration\/","title":{"rendered":"Linux Static IP Address Configuration"},"content":{"rendered":"<p>How do I configure the Internet Protocol version 4 (IPv4) properties of a network connection with a static IP address for servers running Linux operating systems? How do I configure static IP address under Debian Linux or Redhat \/ RHEL \/ Fedora \/ Redhat Enterprise Linux server?<\/p>\n<p>You need to update and\/or edit the network configuration files. This tutorial provides procedures to configure a static IP address on a computer running the following operating systems:<\/p>\n<ol>\n<li>RHEL \/ Red hat \/ Fedora \/ CentOS Linux\u00a0eth0\u00a0config file &#8211;\u00a0\/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/li>\n<li>RHEL \/ Red hat \/ Fedora \/ CentOS Linux\u00a0eth1\u00a0config file &#8211;\u00a0\/etc\/sysconfig\/network-scripts\/ifcfg-eth1<\/li>\n<li>Debian \/ Ubuntu Linux &#8211;\u00a0\/etc\/network\/interfaces<\/li>\n<\/ol>\n<h2>Sample Setup: Linux Static TCP\/IP Settings<\/h2>\n<p>In this example you will use the following Internet Protocol Version 4 (TCP\/IPv4) Properties including IP, default gateway, and preferred DNS servers:<\/p>\n<div><img decoding=\"async\" alt=\"\" src=\"http:\/\/files.cyberciti.biz\/cbzcache\/3rdparty\/networking.png\" border=\"0\" \/><\/div>\n<ul>\n<li>IP address:\u00a0<strong>192.168.1.10<\/strong><\/li>\n<li>Netmask:\u00a0<strong>255.255.255.0<\/strong><\/li>\n<li>Hostname:\u00a0<strong>server1.shineservers.com<\/strong><\/li>\n<li>Domain name:\u00a0<strong>shineservers.com<\/strong><\/li>\n<li>Gateway IP:\u00a0<strong>192.168.1.254<\/strong><\/li>\n<li>DNS Server IP # 1:<strong>\u00a0192.168.1.254<\/strong><\/li>\n<li>DNS Server IP # 2:<strong>\u00a08.8.8.8<\/strong><\/li>\n<li>DNS Server IP # 3:\u00a0<strong>202.54.2.5<\/strong><\/li>\n<\/ul>\n<h3>RHEL \/ Red hat \/ Fedora \/ CentOS Linux Static IP Configuration<\/h3>\n<div><img decoding=\"async\" alt=\"\" src=\"http:\/\/files.cyberciti.biz\/cbzcache\/3rdparty\/rhlogo.gif\" border=\"0\" \/><\/div>\n<p>For static IP configuration you need to edit the following files using a text editor such as vi. Edit\u00a0\/etc\/sysconfig\/network\u00a0as follows, enter:<br \/>\n<code># cat \/etc\/sysconfig\/network<\/code><br \/>\nSample static ip configuration:<\/p>\n<pre>\u00a0\nNETWORKING=yes\nHOSTNAME=server1.shineservers.com\nGATEWAY=192.168.1.254<\/pre>\n<p>Edit \/etc\/sysconfig\/network-scripts\/ifcfg-eth0, enter:<br \/>\n<code># cat \/etc\/sysconfig\/network-scripts\/ifcfg-eth0<\/code><br \/>\nSample static ip configuration:<\/p>\n<pre>\u00a0\n# Intel Corporation 82573E Gigabit Ethernet Controller (Copper)\nDEVICE=eth0\nBOOTPROTO=static\nDHCPCLASS=\nHWADDR=00:30:48:56:A6:2E\nIPADDR=192.168.1.10\nNETMASK=255.255.255.0\nONBOOT=yes<\/pre>\n<p>Edit\u00a0\/etc\/resolv.conf and setup DNS servers, enter:<br \/>\n<code># cat\u00a0\/etc\/resolv.conf<\/code><br \/>\nSample static IP configurations:<\/p>\n<pre>\u00a0\nsearch shineservers.com\nnameserver 192.168.1.254\nnameserver 8.8.8.8\nnameserver 202.54.2.5<\/pre>\n<p>Finally, you need to\u00a0restart the networking service, enter:<br \/>\n<code># \/etc\/init.d\/network restart<\/code><br \/>\nTo verify new static ip configuration for eth0, enter:<br \/>\n<code># ifconfig eth0<br \/>\n#\u00a0route -n<br \/>\n# ping 192.168.1.254<br \/>\n# ping google.com<\/code><\/p>\n<h2>Debian \/ Ubuntu Linux Static IP Configuration<\/h2>\n<div><img decoding=\"async\" alt=\"\" src=\"http:\/\/files.cyberciti.biz\/cbzcache\/3rdparty\/debianlogo.gif\" border=\"0\" \/><\/div>\n<p>Edit \/etc\/hostname, enter:<br \/>\n<code># cat \/etc\/hostname<\/code><br \/>\nSample ip config:<\/p>\n<pre>\u00a0\nserver1.cyberciti.biz<\/pre>\n<p>Edit\u00a0\/etc\/network\/interfaces, enter:<br \/>\n<code># cat \/etc\/network\/interfaces<\/code><br \/>\nSample static ip config:<\/p>\n<pre>\u00a0\niface eth0 inet static\n     address 192.168.1.10\n     network 192.168.1.0\n     netmask 255.255.255.0\n     broadcast 192.168.1.255\n     gateway 192.168.1.254<\/pre>\n<p>Edit\u00a0\/etc\/resolv.conf and setup DNS servers, enter:<br \/>\n<code># cat\u00a0\/etc\/resolv.conf<\/code><br \/>\nSample dns static IP configurations:<\/p>\n<pre>\u00a0\nsearch shineservers.com\nnameserver 192.168.1.254\nnameserver 8.8.8.8\nnameserver 202.54.2.5<\/pre>\n<p>Finally, you need to\u00a0restart the networking service under Debian \/ Ubuntu Linux, enter:<br \/>\n<code># \/etc\/init.d\/networking restart<\/code><\/p>\n<p>Type the following commands to verify your new setup, enter:<br \/>\n<code># ifconfig eth0<br \/>\n# route -n<br \/>\n# ping google.com<\/code><\/p>\n<h3 class=\"zemanta-related-title\" style=\"margin: 0 0 10px 0; padding: 0; clear: both;\">Related articles across the web<\/h3>\n<ul class=\"zemanta-article-ul zemanta-article-ul-image\" style=\"margin: 0; padding: 0; overflow: hidden;\">\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"http:\/\/aarvik.dk\/how-to-configure-static-ip-on-centos-and-debian-a-bit-of-network-utils\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/249898304_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"http:\/\/aarvik.dk\/how-to-configure-static-ip-on-centos-and-debian-a-bit-of-network-utils\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to configure static IP on CentOS and Debian + a bit of network utils<\/a><\/li>\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"http:\/\/www.thegeekstuff.com\/2014\/03\/samba-as-pdc\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/253241161_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"http:\/\/www.thegeekstuff.com\/2014\/03\/samba-as-pdc\/\" target=\"_blank\" rel=\"noopener noreferrer\">How to Setup Samba as Primary Domain Controller in Linux<\/a><\/li>\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"http:\/\/blog.nixpanic.net\/2014\/02\/setting-up-test-environment-for-apache.html\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/noimg_0_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"http:\/\/blog.nixpanic.net\/2014\/02\/setting-up-test-environment-for-apache.html\" target=\"_blank\" rel=\"noopener noreferrer\">Setting up a test-environment for Apache CloudStack and Gluster<\/a><\/li>\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"http:\/\/linuxodisha.wordpress.com\/2014\/02\/17\/install-and-configure-dhcp-server-on-centos-rhel-scientific-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/248833331_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"http:\/\/linuxodisha.wordpress.com\/2014\/02\/17\/install-and-configure-dhcp-server-on-centos-rhel-scientific-linux\/\" target=\"_blank\" rel=\"noopener noreferrer\">Install and configure DHCP server on CentOS \/ RHEL \/ Scientific Linux<\/a><\/li>\n<li class=\"zemanta-article-ul-li-image zemanta-article-ul-li\" style=\"padding: 0; background: none; list-style: none; display: block; float: left; vertical-align: top; text-align: left; width: 104px; font-size: 12px; margin: 0 5px 10px 0;\"><a style=\"padding: 2px; display: block; text-decoration: none;\" href=\"http:\/\/linuxodisha.wordpress.com\/2014\/02\/23\/install-configure-dns-server-in-linux-rhelcentos-6-x\/\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" style=\"border-radius: 3px; box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2); padding: 0; margin: 0; border: 0; display: block; width: 100px; max-width: 100%;\" alt=\"\" src=\"http:\/\/i.zemanta.com\/250588380_150_150.jpg\" \/><\/a><a style=\"display: block; overflow: hidden; text-decoration: none; line-height: 12pt; height: 80px; padding: 5px 2px 0 2px;\" href=\"http:\/\/linuxodisha.wordpress.com\/2014\/02\/23\/install-configure-dns-server-in-linux-rhelcentos-6-x\/\" target=\"_blank\" rel=\"noopener noreferrer\">Install &amp; Configure DNS server in Linux RHEL\/CentOS 6.x<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>How do I configure the Internet Protocol version 4 (IPv4) properties of a network connection with a static IP address for servers running Linux operating systems? How do I configure static IP address under Debian Linux or Redhat \/ RHEL \/ Fedora \/ Redhat Enterprise Linux server? You need to update and\/or edit the network [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[53],"tags":[189],"class_list":["post-14443","post","type-post","status-publish","format-standard","hentry","category-general","tag-static-ip-configuration-linux"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/14443","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/comments?post=14443"}],"version-history":[{"count":0,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/posts\/14443\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/media?parent=14443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/categories?post=14443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shineservers.com\/wp-json\/wp\/v2\/tags?post=14443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}