文档章节

Disable Linux IPv6 Networking

LEAN_IN
 LEAN_IN
发布于 2014/08/05 10:04
字数 656
阅读 89
收藏 1
On most of the Linux distribution IPv6 is enabled by default, which may cause your internet is workding slow, so If your network do not supportor do not setup IPv6 network, you should better to disable IPv6 protocal in linux system and it maybe increate your web browsing speed or network security. So How do I to disable IPv6 on linux operating system? this article will give you a guide for disabling IPv6 networking( linux disable ipv6):

What Is IPv6?

Internet Protocol version 6 (IPv6) is the latest version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. IPv6 was developed by the Internet Engineering Task Force (IETF) to deal with the long-anticipated problem of IPv4 address exhaustion.

How To Check If IPv6 is Enable Or Disable

There are two ways to check if IPv6 is disabled shown as below:

1.Run the “ifconfig” command to check

1 [root@devops ~]# ifconfig
2 eth0      Link encap:Ethernet  HWaddr 00:0C:29:6B:2E:53  
3           inet addr:192.168.1.104  Bcast:192.168.1.255  Mask:255.255.255.0
4           inet6 addr: fe80::20c:29ff:fe6b:2e53/64 Scope:Link
5           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
6           RX packets:345052 errors:0 dropped:0 overruns:0 frame:0
7           TX packets:26332 errors:0 dropped:0 overruns:0 carrier:0
8           collisions:0 txqueuelen:1000
9           RX bytes:97309231 (92.8 MiB)  TX bytes:4735894 (4.5 MiB)
10  
11 lo        Link encap:Local Loopback  
12           inet addr:127.0.0.1  Mask:255.0.0.0
13           inet6 addr: ::1/128 Scope:Host
14           UP LOOPBACK RUNNING  MTU:16436  Metric:1
15           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
16           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
17           collisions:0 txqueuelen:0
18           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

You can check the above line if containing “inet6 addr”, If yes, you machine is running IPv6 service.

2.check “disable_ipv6″ file to check if IPv6 is disabled,enter:

1 [root@devops ~]# cat /proc/sys/net/ipv6/conf/all/disable_ipv6
2 0

if you get “0″ value, it means that IPv6 is enabled and “1″ means it is disabled.

How to Disable IPv6 in linux system?

You need to add the following lines at the end of “/etc/sysctl.conf” file:

Edit file /etc/sysctl.conf, enter the following command:

1 [root@devops ~]# vim /etc/sysctl.conf

Adding the below lines into that file:

1 net.ipv6.conf.all.disable_ipv6 = 1
2 net.ipv6.conf.default.disable_ipv6 = 1
3 net.ipv6.conf.lo.disable_ipv6 = 1

Save and close that file, then restart sysctl with the following command:

1 [root@devops ~]# sysctl -p

Now you can rerun the “ifconfig” command to check if IPv6 lines have been removed.

1 [root@devops ~]# ifconfig
2 eth0      Link encap:Ethernet  HWaddr 00:0C:29:6B:2E:53  
3           inet addr:192.168.1.104  Bcast:192.168.1.255  Mask:255.255.255.0
4           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
5           RX packets:346874 errors:0 dropped:0 overruns:0 frame:0
6           TX packets:26428 errors:0 dropped:0 overruns:0 carrier:0
7           collisions:0 txqueuelen:1000
8           RX bytes:97600047 (93.0 MiB)  TX bytes:4747254 (4.5 MiB)
9  
10 lo        Link encap:Local Loopback  
11           inet addr:127.0.0.1  Mask:255.0.0.0
12           UP LOOPBACK RUNNING  MTU:16436  Metric:1
13           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
14           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
15           collisions:0 txqueuelen:0
16           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

Done!

See Also: IPv6 or IPv4  


本文转载自:http://www.itsprite.com/linuxhow-to-disable-ipv6-networking-on-redhatcentosfedoraubuntu-linux-sys...

共有 人打赏支持
LEAN_IN
粉丝 1
博文 12
码字总数 4141
作品 0
东城
程序员
私信 提问
禁用linux的ipv6

网上找了两种方法,都已验证: 第一种: 1、编辑/boot/grub/grub.conf在以下行结尾加上ipv6.disable=1 kernel /vmlinuz-2.6.32-279.el6.x8664 ro root=UUID=5bd71e9a-7b05-45f8-8928-ce88a292......

chenshifei
2017/02/25
0
0
CentOS 6.6下执行service network restart后原本禁用的IPv6重新激活

本人在VMware下安装了一个CentOS 6.6系统。通过网上提供的一些方案禁用了IPv6。方案如下: echo ' NETWORKING_IPV6=no ' > /etc/sysconfig/network # 注释掉/etc/hosts中的IPv6的域名映射 #:...

Leech
2017/09/29
65
0
net-snmp5.3.2移植 make出错,求牛人解答

已经配置好了,如下: ./configure --build=i386-linux --host=arm-linux --enable-mini-agent --disable-ipv6 --with-endianness=little --disable-manuals --disable-ucd-snmp-compatibili......

袁兀
2011/08/19
902
1
Linux TCP/IP网络管理工具:net-tools VS iproute2

许多系统管理员仍然使用ifconfig、route、arp、netstat 命令组合来管理和排错网络配置,这些命令有net-tools包提供,但在Arch Linux、Centos7/RHEL7等发行版里面已经使用iproute2替代了net-t...

Geekwolf
2014/09/05
0
0
Linux下禁用IPv6

/etc/sysctl.conf 文件 加入以下内容 # IPv6 disabled net.ipv6.conf.all.disable_ipv6 =1 net.ipv6.conf.default.disable_ipv6 =1 net.ipv6.conf.lo.disable_ipv6 =1...

cep
01/18
0
0

没有更多内容

加载失败,请刷新页面

加载更多

ubuntu美化记,-修改皮肤,安装工具。

事情由来 最近系统盘坏了,换了新SSD,也换了新版的ubuntu 18.04LTS;不得不说,ubuntu 的桌面搞的越来越漂亮了。 把调整过的zsh shell样式,截个图上来镇一下楼: 添加了对python virtuale...

janl
8分钟前
0
0
阿里云物联网边缘计算加载MQTT驱动

写在前面 本文在LinkEdge快速入门样例驱动的基础上,加载了MQTT订阅的客户端,使得边缘端容器可以通过MQTT获得外部数据。 1. 系统需求 物联网边缘计算平台,又名Link IoT Edge[1]。在物联网边...

阿里云云栖社区
9分钟前
0
0
错误: 找不到或无法加载主类

在IDEA的使用过程中,经常断掉服务或者重启服务,最近断掉服务重启时突然遇到了一个启动报错: 错误:找不到或无法加载主类 猜测:1,未能成功编译; 尝试:菜单---》Build---》Rebuild Pro...

安小乐
25分钟前
1
0
vue路由传参,刷新页面,引发的bug

最近遇到一个bug 通过vue路由跳转到页面, 然后接参控制(v-if ),成功显示 而刷新页面,显示失败。 苦苦地找了半天原因,打印参数发现正确,再打印下类型......,路由跳过来会保持传参时的...

hanbb
26分钟前
1
0
【58沈剑 架构师之路】InnoDB,select为啥会阻塞insert?

MySQL的InnoDB的细粒度行锁,是它最吸引人的特性之一。 但是,如《InnoDB,5项最佳实践》所述,如果查询没有命中索引,也将退化为表锁。 InnoDB的细粒度锁,是实现在索引记录上的。 一,Inn...

张锦飞
29分钟前
1
0

没有更多内容

加载失败,请刷新页面

加载更多

返回顶部
顶部