Disable Linux IPv6 Networking

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 [[email protected] ~]# 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

Disable Linux IPv6 Networking

时间: 2024-10-01 21:53:47

Disable Linux IPv6 Networking的相关文章

有关Linux ipv6模块加载失败的问题

有关Linux ipv6模块加载失败的问题 同事一个SUSE11sp3环境配置ipv6地址失败,提示不支持IPv6,请求帮助,第一反应是应该ipv6相关内核模块没有加载.     主要检查内容:   ipv6地址是否存在    ifconfig |grep inet6     没有默认inet6地址       ipv6模块是否存在    # modinfo -n ipv6    /lib/modules/3.0.101-0.47.90-default/kernel/net/ipv6/ipv6.

本地win7ping VM linux ipv6地址问题

前述 在windows和linux同时安装ipv6之后,系统将会自动分配一个link-local(链接本地)地址也就是ifconfig -a看到的一行[inet6 addr: fe80::20c:29ff:fed7:4214/64 Scope:Link],黄色部分就是ipv6的链接本地地址. 现在假设win7下通过ipconfig看到的ipv6地址如下: fe80::493e:6c55:cce9:57cd%17 %后面是本ipv6地址对应的网络接口的index,windows术语叫scope i

Linux IPv6 地址配置

添加IPV6地址ip -6 addr add <ipv6address>/<prefixlength> dev <interface>ip -6 addr add 2001:0db8:0:f101::1/64 dev eth0 ifconfig <interface> inet6 add <ipv6address>/<prefixlength>ifconfig eth0 inet6 add 2001:0db8:0:f101::1/64

Disable or enable the IPv6 protocol in Red Hat Enterprise Linux

Resolution Red Hat Enterprise Linux 4, 5 and 6 enable Internet Protocol Version 6 (IPv6) by default. However, in certain situations, some users may find it desirable to disable IPv6 support or to re-enable it after it has been disabled. For Red Hat E

Ubuntu系统启用IPv6的两种方法

IPv6就是我们通常所说的互联网协议,是TCP/IP的核心协议,那么在Linux下如何开启IPv6呢?下面以Ubuntu为例,给大家介绍下Ubuntu启用IPv6的方法. 方法: $sudo apt-get install miredo $ifconfig 在结果中应该能看见一个叫 teredo 的虚拟网卡. $ ping6 ipv6.google.com PING ipv6.google.com(2404:6800:8003::93) 56 data bytes 64 bytes from 2

CentOS(6.8)linux生产环境若干优化实战

CentOS系统安装之后并不能立即投入生产环境使用,需要经过运维人员的优化才行.在此讲解几点关于Linux系统安装后的基础优化操作. 注意:不同版本5.x和6.x两者优化时会有些区别. CentOS修改时区 echo 'ZONE="Asia/Shanghai"' > /etc/sysconfig/clock cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 优化条目: 1.   修改ip地址.网关.主机名.DNS等 2.

linux基础学习第十八天之网络配置

内容:     IP地址的相关设置(IP地址.网关.路由.DNS.主机名)     ip命令的使用     网卡别名设置     多网卡的bonding设置     IP地址的相关设置 一.IP地址的相关设置 (1)配置IP地址: ifconfig: -a:显示所有网卡的信息 ifconfig eth0 IPADDR/MASK [up|down]:配置立刻生效,但不是永久生效 配置文件:重启网络服务或主机后会永久生效 /etc/sysconfig/network-scripts/ifcfg-et

Linux系统优化脚本

#!/bin/bash  #this script is only for CentOS 6 #check the OS platform=`uname -i` if [ $platform != "x86_64" ];then echo "this script is only for 64bit Operating System !" exit 1 fi echo "the platform is ok" version=`lsb_relea

Linux LSM(Linux Security Modules) Hook Technology(undone)

目录 0. 引言 1. Linux Security Module Framework Introduction 2. LSM Sourcecode Analysis 3. LSMs Hook Engine:基于LSM Hook进行元数据的监控获取 4. LSM编程示例 0. 引言 从最佳实践的角度来说,在Linux Kernel中进行安全审计.Access Control(访问控制)最好的方式就是使用Linux提供的原生的框架机制,例如 1. Kprobe: Linux提供的原生的调试机制(D