{"id":2633,"date":"2019-06-23T13:00:37","date_gmt":"2019-06-23T07:30:37","guid":{"rendered":"https:\/\/www.24x7serversupport.com\/blog\/?p=2633"},"modified":"2019-06-23T13:34:12","modified_gmt":"2019-06-23T08:04:12","slug":"how-to-change-your-ip-address-from-the-command-line-in-linux","status":"publish","type":"post","link":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/","title":{"rendered":"How to Change Your IP Address From the Command Line in Linux"},"content":{"rendered":"\n<p> This trick should work on all Debian-based Linux distros, including Ubuntu. To get started, type&nbsp;<code>ifconfig<\/code>&nbsp;at the terminal prompt, and then hit Enter. This command lists all network interfaces on the system, so take note of the name of the interface for which you want to change the IP address. <\/p>\n\n\n\n<p> To change the settings, you also use the ifconfig command, this time with a few additional parameters. The following command changes the network interface named \u201ceth1\u201d to use the IP address 192.168.0.3, and assigns the subnet mask 255.255.255.0:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">ifconfig eth1 192.168.0.3 netmask 255.255.255.0<\/pre>\n\n\n\n<p> You could, of course, substitute in whatever values you want.&nbsp;If you run ifconfig again, you will see that your interface has now taken on the new settings you assigned to it. <\/p>\n\n\n\n<p> If you also need to change the Default Gateway used by the network interface, you can use the route command. The following command, for example, sets the default gateway for the \u201ceth1\u201d interface to 192.168.0.253:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\"> route add default gw 192.168.0.253 eth1\n\n To see your new setting, you will need to display the routing table. Type the following command at the prompt, and then hit Enter\n\n route -n\n\n \n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>This trick should work on all Debian-based Linux distros, including Ubuntu. To get started, type&nbsp;ifconfig&nbsp;at the terminal prompt, and then hit Enter. This command lists all network interfaces on the system, so take note of the name of the interface for which you want to change the IP address. To change the settings, you also [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":2639,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[166],"tags":[112,83,99],"class_list":["post-2633","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu","tag-linux","tag-ubuntu","tag-ubuntu14"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Change Your IP Address From the Command Line in Linux | 24x7serversupport Blog<\/title>\n<meta name=\"description\" content=\"How to Change Your IP Address From the Command Line in Linux\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Change Your IP Address From the Command Line in Linux | 24x7serversupport Blog\" \/>\n<meta property=\"og:description\" content=\"How to Change Your IP Address From the Command Line in Linux\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/\" \/>\n<meta property=\"og:site_name\" content=\"24x7serversupport Blog\" \/>\n<meta property=\"article:published_time\" content=\"2019-06-23T07:30:37+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-06-23T08:04:12+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2019\/06\/ip-change.png?fit=657%2C369&ssl=1\" \/>\n\t<meta property=\"og:image:width\" content=\"657\" \/>\n\t<meta property=\"og:image:height\" content=\"369\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"24x7support\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:site\" content=\"@24x7serversuppo\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"24x7support\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/\",\"name\":\"How to Change Your IP Address From the Command Line in Linux | 24x7serversupport Blog\",\"isPartOf\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2019\/06\/ip-change.png?fit=657%2C369&ssl=1\",\"datePublished\":\"2019-06-23T07:30:37+00:00\",\"dateModified\":\"2019-06-23T08:04:12+00:00\",\"author\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\"},\"description\":\"How to Change Your IP Address From the Command Line in Linux\",\"breadcrumb\":{\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#primaryimage\",\"url\":\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2019\/06\/ip-change.png?fit=657%2C369&ssl=1\",\"contentUrl\":\"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2019\/06\/ip-change.png?fit=657%2C369&ssl=1\",\"width\":657,\"height\":369},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.24x7serversupport.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Change Your IP Address From the Command Line in Linux\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#website\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/\",\"name\":\"24x7serversupport Blog\",\"description\":\"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401\",\"name\":\"24x7support\",\"url\":\"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Change Your IP Address From the Command Line in Linux | 24x7serversupport Blog","description":"How to Change Your IP Address From the Command Line in Linux","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/","og_locale":"en_US","og_type":"article","og_title":"How to Change Your IP Address From the Command Line in Linux | 24x7serversupport Blog","og_description":"How to Change Your IP Address From the Command Line in Linux","og_url":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/","og_site_name":"24x7serversupport Blog","article_published_time":"2019-06-23T07:30:37+00:00","article_modified_time":"2019-06-23T08:04:12+00:00","og_image":[{"width":657,"height":369,"url":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2019\/06\/ip-change.png?fit=657%2C369&ssl=1","type":"image\/png"}],"author":"24x7support","twitter_card":"summary_large_image","twitter_creator":"@24x7serversuppo","twitter_site":"@24x7serversuppo","twitter_misc":{"Written by":"24x7support","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/","url":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/","name":"How to Change Your IP Address From the Command Line in Linux | 24x7serversupport Blog","isPartOf":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#primaryimage"},"image":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#primaryimage"},"thumbnailUrl":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2019\/06\/ip-change.png?fit=657%2C369&ssl=1","datePublished":"2019-06-23T07:30:37+00:00","dateModified":"2019-06-23T08:04:12+00:00","author":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401"},"description":"How to Change Your IP Address From the Command Line in Linux","breadcrumb":{"@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#primaryimage","url":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2019\/06\/ip-change.png?fit=657%2C369&ssl=1","contentUrl":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2019\/06\/ip-change.png?fit=657%2C369&ssl=1","width":657,"height":369},{"@type":"BreadcrumbList","@id":"https:\/\/www.24x7serversupport.com\/blog\/how-to-change-your-ip-address-from-the-command-line-in-linux\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.24x7serversupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Change Your IP Address From the Command Line in Linux"}]},{"@type":"WebSite","@id":"https:\/\/www.24x7serversupport.com\/blog\/#website","url":"https:\/\/www.24x7serversupport.com\/blog\/","name":"24x7serversupport Blog","description":"Linux | CPanel | WHM | webhosting| Plesk | DirectAdmin | CentOs | Debian | Ubuntu Blog","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.24x7serversupport.com\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.24x7serversupport.com\/blog\/#\/schema\/person\/decfb5fad6bde6ac6822d4e965c6d401","name":"24x7support","url":"https:\/\/www.24x7serversupport.com\/blog\/author\/24x7support\/"}]}},"jetpack_featured_media_url":"https:\/\/i0.wp.com\/www.24x7serversupport.com\/blog\/wp-content\/uploads\/2019\/06\/ip-change.png?fit=657%2C369&ssl=1","jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/2633","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/comments?post=2633"}],"version-history":[{"count":2,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/2633\/revisions"}],"predecessor-version":[{"id":2640,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/posts\/2633\/revisions\/2640"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media\/2639"}],"wp:attachment":[{"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/media?parent=2633"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/categories?post=2633"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.24x7serversupport.com\/blog\/wp-json\/wp\/v2\/tags?post=2633"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}