{"id":3609,"date":"2019-04-01T05:06:45","date_gmt":"2019-04-01T09:06:45","guid":{"rendered":"http:\/\/thebackroomtech.com\/?p=3609"},"modified":"2019-03-31T22:18:05","modified_gmt":"2019-04-01T02:18:05","slug":"change-ip-address-in-linux-using-terminal","status":"publish","type":"post","link":"https:\/\/thebackroomtech.com\/change-ip-address-in-linux-using-terminal\/","title":{"rendered":"Change IP Address in Linux Using Terminal"},"content":{"rendered":"\n<p>Hello everybody and welcome to another fun article that takes us back to basics in the world of Linux. I know this article might seem too basic, but a lot of people ask me \u201cHow do I change my IP address on my Linux box?\u201d all the time. For that, I\u2019ve created this simple to follow guide to come to your aid.<\/p>\n\n\n\n<p>Now that we\u2019ve got the introduction done, let\u2019s jump in and change the network configuration on a CentOS server.<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter\"><img decoding=\"async\" width=\"680\" height=\"318\" src=\"https:\/\/thebackroomtech.com\/wp-content\/uploads\/ip-address-1.jpeg\" alt=\"\" class=\"wp-image-3610\" srcset=\"https:\/\/thebackroomtech.com\/wp-content\/uploads\/ip-address-1.jpeg 680w, https:\/\/thebackroomtech.com\/wp-content\/uploads\/ip-address-1-300x140.jpeg 300w, https:\/\/thebackroomtech.com\/wp-content\/uploads\/ip-address-1-80x37.jpeg 80w\" sizes=\"(max-width: 680px) 100vw, 680px\" \/><\/figure><\/div>\n\n\n\n<p>I\u2019m using a virtual machine, so I\u2019m going to have my console open to the server, but you can use Putty or Terminal depending on your needs or your environment.<\/p>\n\n\n\n<p>Once we\u2019ve logged in, we\u2019re at the default prompt, so the first thing we\u2019ll do is change our working directory to the <strong><em>network-scripts<\/em><\/strong> one.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong><em># cd\n\/etc\/sysconfig\/network-scripts<\/em><\/strong><\/pre>\n\n\n\n<p>Now in that folder we will have a file named <strong><em>ifcfg-<\/em><\/strong> and the type of network connection that you have. It can be <strong><em>eno<\/em><\/strong> for VMware machines or <strong><em>eth<\/em><\/strong> for other types of VMs or physical machines. But it always starts with <strong><em>ifcfg-<\/em><\/strong>.<\/p>\n\n\n\n<p>In my case the network\ninterface is <strong><em>ifcfg-eno16777984<\/em><\/strong>.<\/p>\n\n\n\n<p>So what I\u2019m going to\ndo next is to edit that file using vi and change the values.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong><em># vi\nifcfg-eno16777984<\/em><\/strong><\/pre>\n\n\n\n<p>Now we are going to\nget the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><em>TYPE=\"Ethernet\"<\/em><br><em>BOOTPROTO=\"none\"<\/em><br><em>DEFROUTE=\"yes\"<\/em><br><em>IPV4_FAILURE_FATAL=\"no\"<\/em><br><em>IPV6INIT=\"yes\"<\/em><br><em>IPV6_AUTOCONF=\"yes\"<\/em><br><em>IPV6_DEFROUTE=\"yes\"<\/em><br><em>IPV6_FAILURE_FATAL=\"no\"<\/em><br><em>NAME=\"nic1\"<\/em><br><em>UUID=\"e24c5ba8-46ad-41ed-af8e-1fb6f75d98bc\"<\/em><br><em>DEVICE=\"eno16777984\"<\/em><br><em>ONBOOT=\"yes\"<\/em><br><strong><em>IPADDR=\"192.168.1.20\"<\/em><\/strong><br><strong><em>NETMASK=\"255.255.255.0\"<\/em><\/strong><br><strong><em>GATEWAY=\"192.168.1.254\"<\/em><\/strong><br><strong><em>DNS1=\"192.168.1.1\"<\/em><\/strong><br><em>DNS2=\"\"<\/em><br><em>DNS3=\"\"<\/em><br><em>DOMAIN=\"home\"<\/em><br><em>IPV6_PEERDNS=\"yes\"<\/em><br><em>IPV6_PEERROUTES=\"yes\"<\/em><br><em>IPV6_PRIVACY=\"no\"<\/em><\/pre>\n\n\n\n<p>This file is pretty self-explanatory. We will need to change the value of <strong><em>IPADDR<\/em><\/strong>, <strong><em>NETMASK<\/em><\/strong>, <strong><em>GATEWAY<\/em><\/strong> and <strong><em>DNS<\/em><\/strong> to the values we want and then just reload the network adapter.<\/p>\n\n\n\n<p>After we\u2019ve changed the values, we will perform the following steps for the system to reload the network configuration.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong><em># ifdown<\/em><\/strong><\/pre>\n\n\n\n<pre class=\"wp-block-preformatted\"><strong><em># ifup<\/em><\/strong><\/pre>\n\n\n\n<p>Following those two commands, the network interface is taken offline and online, and the configuration is reloaded.<\/p>\n\n\n\n<p>Simple, right? Hope\nyou enjoyed the article!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello everybody and welcome to another fun article that takes us back to basics in the world of Linux. I know this article might seem too basic, but a lot [&hellip;]<\/p>\n","protected":false},"author":8,"featured_media":3610,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"updated_on":"","footnotes":""},"categories":[32],"tags":[],"class_list":{"0":"post-3609","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-linux"},"acf":[],"aioseo_notices":[],"aioseo_head":"\n\t\t<!-- All in One SEO Pro 4.9.5.2 - aioseo.com -->\n\t<meta name=\"description\" content=\"Hello everybody and welcome to another fun article that takes us back to basics in the world of Linux. I know this article might seem too basic, but a lot of people ask me \u201cHow do I change my IP address on my Linux box?\u201d all the time. For that, I\u2019ve created this simple to\" \/>\n\t<meta name=\"robots\" content=\"max-image-preview:large\" \/>\n\t<meta name=\"author\" content=\"Sabrin Alexander\"\/>\n\t<link rel=\"canonical\" href=\"https:\/\/thebackroomtech.com\/change-ip-address-in-linux-using-terminal\/\" \/>\n\t<meta name=\"generator\" content=\"All in One SEO Pro (AIOSEO) 4.9.5.2\" \/>\n\t\t<meta property=\"og:locale\" content=\"en_US\" \/>\n\t\t<meta property=\"og:site_name\" content=\"The Back Room Tech - Serving up the info for back room techs everywhere\" \/>\n\t\t<meta property=\"og:type\" content=\"article\" \/>\n\t\t<meta property=\"og:title\" content=\"Change IP Address in Linux Using Terminal - The Back Room Tech\" \/>\n\t\t<meta property=\"og:description\" content=\"Hello everybody and welcome to another fun article that takes us back to basics in the world of Linux. I know this article might seem too basic, but a lot of people ask me \u201cHow do I change my IP address on my Linux box?\u201d all the time. For that, I\u2019ve created this simple to\" \/>\n\t\t<meta property=\"og:url\" content=\"https:\/\/thebackroomtech.com\/change-ip-address-in-linux-using-terminal\/\" \/>\n\t\t<meta property=\"article:published_time\" content=\"2019-04-01T09:06:45+00:00\" \/>\n\t\t<meta property=\"article:modified_time\" content=\"2019-04-01T02:18:05+00:00\" \/>\n\t\t<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n\t\t<meta name=\"twitter:title\" content=\"Change IP Address in Linux Using Terminal - The Back Room Tech\" \/>\n\t\t<meta name=\"twitter:description\" content=\"Hello everybody and welcome to another fun article that takes us back to basics in the world of Linux. I know this article might seem too basic, but a lot of people ask me \u201cHow do I change my IP address on my Linux box?\u201d all the time. For that, I\u2019ve created this simple to\" \/>\n\t\t<script type=\"application\/ld+json\" class=\"aioseo-schema\">\n\t\t\t{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[]}\n\t\t<\/script>\n\t\t<!-- All in One SEO Pro -->\r\n\t\t<title>Change IP Address in Linux Using Terminal - The Back Room Tech<\/title>\n\n","aioseo_head_json":{"title":"Change IP Address in Linux Using Terminal - The Back Room Tech","description":"Hello everybody and welcome to another fun article that takes us back to basics in the world of Linux. I know this article might seem too basic, but a lot of people ask me \u201cHow do I change my IP address on my Linux box?\u201d all the time. For that, I\u2019ve created this simple to","canonical_url":"https:\/\/thebackroomtech.com\/change-ip-address-in-linux-using-terminal\/","robots":"max-image-preview:large","keywords":"","webmasterTools":{"miscellaneous":""},"schema":{"@context":"https:\/\/schema.org","@graph":[]},"og:locale":"en_US","og:site_name":"The Back Room Tech - Serving up the info for back room techs everywhere","og:type":"article","og:title":"Change IP Address in Linux Using Terminal - The Back Room Tech","og:description":"Hello everybody and welcome to another fun article that takes us back to basics in the world of Linux. I know this article might seem too basic, but a lot of people ask me \u201cHow do I change my IP address on my Linux box?\u201d all the time. For that, I\u2019ve created this simple to","og:url":"https:\/\/thebackroomtech.com\/change-ip-address-in-linux-using-terminal\/","article:published_time":"2019-04-01T09:06:45+00:00","article:modified_time":"2019-04-01T02:18:05+00:00","twitter:card":"summary_large_image","twitter:title":"Change IP Address in Linux Using Terminal - The Back Room Tech","twitter:description":"Hello everybody and welcome to another fun article that takes us back to basics in the world of Linux. I know this article might seem too basic, but a lot of people ask me \u201cHow do I change my IP address on my Linux box?\u201d all the time. For that, I\u2019ve created this simple to"},"aioseo_meta_data":{"post_id":"3609","title":null,"description":null,"keywords":null,"keyphrases":null,"primary_term":null,"canonical_url":null,"og_title":null,"og_description":null,"og_object_type":"default","og_image_type":"default","og_image_url":null,"og_image_width":null,"og_image_height":null,"og_image_custom_url":null,"og_image_custom_fields":null,"og_video":null,"og_custom_url":null,"og_article_section":null,"og_article_tags":null,"twitter_use_og":false,"twitter_card":"default","twitter_image_type":"default","twitter_image_url":null,"twitter_image_custom_url":null,"twitter_image_custom_fields":null,"twitter_title":null,"twitter_description":null,"schema":{"blockGraphs":[],"customGraphs":[],"default":{"data":{"Article":[],"Course":[],"Dataset":[],"FAQPage":[],"Movie":[],"Person":[],"Product":[],"ProductReview":[],"Car":[],"Recipe":[],"Service":[],"SoftwareApplication":[],"WebPage":[]},"graphName":"","isEnabled":true},"graphs":[]},"schema_type":"default","schema_type_options":null,"pillar_content":false,"robots_default":true,"robots_noindex":false,"robots_noarchive":false,"robots_nosnippet":false,"robots_nofollow":false,"robots_noimageindex":false,"robots_noodp":false,"robots_notranslate":false,"robots_max_snippet":null,"robots_max_videopreview":null,"robots_max_imagepreview":"large","priority":null,"frequency":null,"local_seo":null,"seo_analyzer_scan_date":"2026-03-27 20:39:57","breadcrumb_settings":null,"limit_modified_date":false,"reviewed_by":null,"open_ai":null,"ai":null,"created":"2026-03-27 20:27:05","updated":"2026-03-27 23:27:34"},"aioseo_breadcrumb":"<div class=\"aioseo-breadcrumbs\"><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/thebackroomtech.com\" title=\"Home\">Home<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\t<a href=\"https:\/\/thebackroomtech.com\/category\/linux\/\" title=\"Linux\">Linux<\/a>\n<\/span><span class=\"aioseo-breadcrumb-separator\">&raquo;<\/span><span class=\"aioseo-breadcrumb\">\n\tChange IP Address in Linux Using Terminal\n<\/span><\/div>","aioseo_breadcrumb_json":[{"label":"Home","link":"https:\/\/thebackroomtech.com"},{"label":"Linux","link":"https:\/\/thebackroomtech.com\/category\/linux\/"},{"label":"Change IP Address in Linux Using Terminal","link":"https:\/\/thebackroomtech.com\/change-ip-address-in-linux-using-terminal\/"}],"_links":{"self":[{"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/posts\/3609","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/users\/8"}],"replies":[{"embeddable":true,"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/comments?post=3609"}],"version-history":[{"count":0,"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/posts\/3609\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/media\/3610"}],"wp:attachment":[{"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/media?parent=3609"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/categories?post=3609"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thebackroomtech.com\/wp-json\/wp\/v2\/tags?post=3609"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}