linux 关闭停用ipv6方法

简介:

一、需求

因不需要ipv6功能,所以可以将其关闭。

二、步骤

1.修改/etc/sysconfig/network 相应网卡,追加:
 代码如下      

1
NETWORKING_IPV6=no

2.修改/etc/hosts,把ipv6的那句本地主机名解析的也注释掉:
 代码如下      

1
#::1   localhost localhost6 localhost6.localdomain6

3.创建文件/etc/modprobe.d/ipv6off.conf(名字随便起)

注:RHEL6.0之后没有了/etc/modprobe.conf这个文件
 代码如下      

1
2
alias  net-pf-10 off
options ipv6 disable=1

4. 重启系统,然后确认:
 代码如下      

1
2
[root@ test  ~] # lsmod | grep -i ipv6
[root@ test  ~] # ifconfig | grep -i inet6

如果上述2个命令执行的结果没有任何显示,那么说明ipv6已经被完全禁止了。

其它:

在不加载ipv6模块的方法里,有人会有类似这样的设置方法:
 代码如下      

1
2
3
alias  net-pf-10 off
alias  ipv6 off
options ipv6 disable=1


虽然这样在系统重启后,ipv6的确没被加载,但是因为第二句,在有的版本的系统里,当我们重启网络的时候,会出现错误:FATAL: Module off not found.

1
2
3
4
5
6
7
8
9
RedHat 5.x
To disable IPv6  in  a virtual machine running RedHat 5.x:
1.Log  in  as root or superuser. www.111cn.net
2.If the  /etc/sysconfig/network  file  contains the line NETWORKING_IPV6= yes , change the line to:
NETWORKING_IPV6=no
3.In the  file  /etc/modprobe .conf, add this line:
options ipv6 disable=1
4.Save the  file  and reboot the system.
After you disable IPv6, you should be able to  install  and configure VMware Tools successfully.


原文链接:http://www.3lian.com/edu/2013/12-28/119848.html





      本文转自独弹古调  51CTO博客,原文链接:http://blog.51cto.com/hunkz/1883390,如需转载请自行联系原作者





相关文章
|
25天前
|
关系型数据库 MySQL Linux
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
linux CentOS 7.4下 mysql5.7.20 密码改简单的方法
23 0
|
1月前
|
Ubuntu Linux
常用Linux开机启动添加方法
常用Linux开机启动添加方法
17 1
|
2月前
|
安全 Linux 开发者
⭐⭐⭐⭐⭐Linux C/C++ 进程崩溃诊断以及有效数据收集:解锁代码问题快速定位与修复的方法
⭐⭐⭐⭐⭐Linux C/C++ 进程崩溃诊断以及有效数据收集:解锁代码问题快速定位与修复的方法
87 1
|
2天前
|
网络协议 Linux
如何在 Linux 中禁用 IPv6?
【5月更文挑战第2天】
18 8
如何在 Linux 中禁用 IPv6?
|
4天前
|
Ubuntu Unix Linux
|
10天前
|
人工智能 Linux
Linux查找大文件的方法
Linux查找大文件的方法
|
25天前
|
Shell Linux
在linux shell脚本中root切换到普通用户执行脚本或命令的方法
在linux shell脚本中root切换到普通用户执行脚本或命令的方法
12 1
|
25天前
|
Linux Shell 虚拟化
linux 部署docker容器虚拟化平台(二)--------docker 镜像制作方法
linux 部署docker容器虚拟化平台(二)--------docker 镜像制作方法
33 0
|
25天前
|
Ubuntu Java Linux
linux安装软件和卸载的几种方法
linux安装软件和卸载的几种方法
11 0
|
27天前
|
监控 Linux