{"id":6439,"date":"2016-03-15T14:33:24","date_gmt":"2016-03-15T06:33:24","guid":{"rendered":"https:\/\/webhostinggeeks.com\/howto\/?p=6439"},"modified":"2023-04-28T09:47:07","modified_gmt":"2023-04-28T09:47:07","slug":"disable-ipv6-on-redhat-centos-6-centos-7","status":"publish","type":"post","link":"https:\/\/webhostinggeeks.com\/howto\/disable-ipv6-on-redhat-centos-6-centos-7\/","title":{"rendered":"How to Disable IPv6 on Redhat \/ CentOS 6 \/ CentOS 7"},"content":{"rendered":"<p><img decoding=\"async\" class=\"alignnone wp-image-6635 size-full lazyload\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-1.png\" alt=\"Disable IPv6 on Redhat\" width=\"838\" height=\"458\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-1.png 838w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-1-300x164.png 300w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-1-768x420.png 768w\" data-sizes=\"(max-width: 838px) 100vw, 838px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 838px; --smush-placeholder-aspect-ratio: 838\/458;\" \/><\/p>\n<p>This howto will show you how to disable IPv6 on RHEL 6\/7, CentOS 6, and CentOS7.<\/p>\n<p>IPv6 is enabled by default. In this article, I summarize 3 configuration which needs to be changed to completely disable IPv6.<\/p>\n<p>Check the configuration of the existing network with the &#8220;ifconfig&#8221; command. If inet6 appears in the configuration, that means IPv6 is enabled.<\/p>\n<h2>Here&#8217;s how to disable IPv6 on Redhat \/ CentOS 6 \/ CentOS 7:<\/h2>\n<p>1. Update \/etc\/sysctl.conf:<\/p>\n<p>Method 1:<\/p>\n<pre># vi \/etc\/sysctl.conf\r\n<\/pre>\n<p>Add the following :<\/p>\n<pre>net.ipv6.conf.all.disable_ipv6 = 1\r\nnet.ipv6.conf.default.disable_ipv6 = 1\r\n<\/pre>\n<p>Run the following command to take effect.<\/p>\n<pre># sysctl -p\r\n<\/pre>\n<p>Method 2:<\/p>\n<p>To disable ipv6 in the running system:<\/p>\n<pre># echo 1 &gt; \/proc\/sys\/net\/ipv6\/conf\/all\/disable_ipv6\r\n# echo 1 &gt; \/proc\/sys\/net\/ipv6\/conf\/default\/disable_ipv6\r\n<\/pre>\n<p>or<\/p>\n<pre># sysctl -w net.ipv6.conf.all.disable_ipv6=1\r\n# sysctl -w net.ipv6.conf.default.disable_ipv6=1\r\n<\/pre>\n<p>2. Update config file in\/etc\/sysconfig\/network-scripts\/ifcfg-eth0 and \/etc\/sysconfig\/network-scripts\/ifcfg-ens160:<\/p>\n<p>For CentOS 6:<\/p>\n<pre># vi \/etc\/sysconfig\/network-scripts\/ifcfg-eth0\r\n<\/pre>\n<pre>DEVICE=eth0\r\nHWADDR=00:0C:29:C5:36:7C\r\nTYPE=Ethernet\r\nUUID=f9db89e6-013a-4403-8893-ae0536c6306f\r\nONBOOT=yes\r\nNM_CONTROLLED=no\r\nBOOTPROTO=static\r\nIPADDR=192.168.0.9\r\nNETMASK=255.255.255.0\r\nIPV6INIT=no\r\n<\/pre>\n<p>For CentOS 7:<\/p>\n<pre># vi \/etc\/sysconfig\/network-scripts\/ifcfg-ens160\r\n<\/pre>\n<pre>TYPE=\"Ethernet\"\r\nBOOTPROTO=\"static\"\r\nDEFROUTE=\"yes\"\r\nIPV4_FAILURE_FATAL=\"no\"\r\nIPV6INIT=\"no\"\r\nIPV6_AUTOCONF=\"no\"\r\nIPV6_DEFROUTE=\"no\"\r\nIPV6_FAILURE_FATAL=\"yes\"\r\nNAME=\"ens32\"\r\nUUID=\"ccfd7425-20ab-40c9-a141-b71828a1b8bf\"\r\nDEVICE=\"ens160\"\r\nONBOOT=\"yes\"\r\nIPADDR=\"192.168.0.100\"\r\nPREFIX=\"24\"\r\nGATEWAY=\"192.168.0.1\"\r\nDNS1=\"8.8.8.8\"\r\nDOMAIN=\"ehowstuff.local\"\r\nIPV6_PEERDNS=\"no\"\r\nIPV6_PEERROUTES=\"no\"\r\nIPV6_PRIVACY=\"no\"\r\n<\/pre>\n<p><img decoding=\"async\" class=\"alignnone wp-image-6634 size-full lazyload\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-3.png\" alt=\"Disable IPv6 on Redhat\" width=\"868\" height=\"607\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-3.png 868w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-3-300x210.png 300w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-3-768x537.png 768w\" data-sizes=\"(max-width: 868px) 100vw, 868px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 868px; --smush-placeholder-aspect-ratio: 868\/607;\" \/><\/p>\n<p>3. Edit \/etc\/sysconfig\/network file and add &#8220;no&#8221; to NETWORKING_IPV6.<\/p>\n<pre># vi \/etc\/sysconfig\/network\r\n<\/pre>\n<pre>NETWORKING_IPV6=no\r\n<\/pre>\n<p><img decoding=\"async\" class=\"alignnone wp-image-6633 size-full lazyload\" data-src=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-4.png\" alt=\"Disable IPv6 on Redhat\" width=\"889\" height=\"301\" data-srcset=\"https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-4.png 889w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-4-300x102.png 300w, https:\/\/webhostinggeeks.com\/howto\/wp-content\/uploads\/2016\/03\/disable-ipv6-centos-4-768x260.png 768w\" data-sizes=\"(max-width: 889px) 100vw, 889px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 889px; --smush-placeholder-aspect-ratio: 889\/301;\" \/><\/p>\n<p>I would advise you to restart the network configuration as below:<\/p>\n<p>For CentOS 6:<\/p>\n<pre># service network restart\r\n<\/pre>\n<p>For CentOS 7:<\/p>\n<pre># systemctl restart network\r\n<\/pre>\n<p>Source :\u00a0<a href=\"https:\/\/wiki.centos.org\/FAQ\/CentOS6\" target=\"_blank\" rel=\"noopener\">https:\/\/wiki.centos.org\/FAQ\/CentOS6<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This howto will show you how to disable IPv6 on RHEL 6\/7, CentOS 6, and CentOS7. IPv6 is enabled by default. In this article, I summarize 3 configuration which needs&#8230;<\/p>\n","protected":false},"author":6,"featured_media":6636,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"wds_primary_category":0,"footnotes":""},"categories":[2055,996],"tags":[1520,1536],"class_list":["post-6439","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-centos","category-linux","tag-ipv6","tag-linux"],"_links":{"self":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/6439","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=6439"}],"version-history":[{"count":0,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/posts\/6439\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media\/6636"}],"wp:attachment":[{"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/media?parent=6439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/categories?post=6439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webhostinggeeks.com\/howto\/wp-json\/wp\/v2\/tags?post=6439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}