当前位置: 首页 » 产品 » 家居百货 » 正文

linux 关闭停用ipv6方法

放大字体  缩小字体 发布日期: 2025-05-02 18:51   来源:http://www.baidu.com/  作者:无忧资讯  浏览次数:31
核心提示:  .修改/etc/sysconfig/network 相应网卡,追加:代码如下 NETWORKING_IPV6=no   2.修改/etc/hosts,把ipv6的那句本地主机名

  .修改/etc/sysconfig/network 相应网卡,追加:

 代码如下      

NETWORKING_IPV6=no

 

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

 代码如下      

#::1   localhost localhost6 localhost6.localdomain6

 

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

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

 代码如下      

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

 

  4. 重启系统,然后确认:

 代码如下      
[root@test ~]# lsmod | grep -i ipv6
[root@test ~]# ifconfig | grep -i inet6
 

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

  其它:

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

 代码如下      
alias net-pf-10 off
alias ipv6 off
options ipv6 disable=1
 

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

  RedHat 5.x

  To disable IPv6 in a virtual machine running RedHat 5.x:

  1.Log in as root or superuser.

  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.

内容来源:
 
 
[ 产品搜索 ]  [ 加入收藏 ]  [ 告诉好友 ]  [ 打印本文 ]  [ 违规举报 ]  [ 关闭窗口 ]

 

 
    行业协会  备案信息  可信网站