查看服务监听的IP中是否有IPv6格式的地址

netstat -tuln

如果有tcp6协议的就是有打开ip6

编辑/etc/default/grub,在GRUB_CMDLINE_LINUX加上的后面句首加上ipv6.disable=1。
修改前:
[root@localhost Desktop]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"

修改后:

[root@localhost Desktop]# cat /etc/default/grub
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
GRUB_DEFAULT=saved
GRUB_DISABLE_SUBMENU=true
GRUB_TERMINAL_OUTPUT="console"
GRUB_CMDLINE_LINUX="ipv6.disable=1 rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
GRUB_DISABLE_RECOVERY="true"
修改完毕后保存,运行grub2-mkconfig -o /boot/grub2/grub.cfg重新生成grub.cfg文件。
[root@localhost Desktop]# grub2-mkconfig -o /boot/grub2/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-514.2.2.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-514.2.2.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-327.36.3.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.36.3.el7.x86_64.img
Found linux image: /boot/vmlinuz-3.10.0-327.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-327.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-d885883cdb4944609bc5e3493dd2b680
Found initrd image: /boot/initramfs-0-rescue-d885883cdb4944609bc5e3493dd2b680.img
done
重启系统,查看ip6是否关闭。
 

CentOS7 彻底关闭 IPV6的更多相关文章

  1. 图解centos7如何关闭ipv6仅使用ipv4

    方法/步骤     使用ifconfig命令查看网卡信息,如果出现inet6 fe80::20c:29ff:fed0:3514,说明机器开启了ipv6,如下图所示:   编辑/etc/sysctl.c ...

  2. centos6关闭ipv6

    Install packages for CentOS 6.0 Minimal cat <<EOF>>/etc/modprobe.d/disable_ipv6.conf ali ...

  3. centos网速特别慢的最佳解决的方法 - 关闭ipv6

    我使用了centOS,可是发现网速实在是卡得差点儿不能上网,连百度都打不开,可是win却飞快. 后来想到偶然记得有一次看过一段话,说到关闭ipv6,測试来一下,果然有效,关闭来ipv6打开网速飞快. ...

  4. 关闭ipv6的方法

    公司研发反应,几台机器开了一些端口,但是访问一直不通. 检查后发现,发现服务开启的是ipv6的端口,所有首先想到的办法就是关闭ipv6. 关闭ipv6的方法有两种: 第一个是在内核配置文件修改配置(p ...

  5. linux系统关闭IPv6的方式

    云服务器 ECS> Linux操作运维问题 > 应用配置 > linux系统关闭IPv6的方式 linux系统关闭IPv6的方式 IPv6被认为是IPv4的替代产品,它用来解决现有I ...

  6. Linux关闭IPV6

    Linux关闭IPV6的方法 修改配置文件/etc/sysctl.conf添加以下1行 net.ipv6.conf.all.disable_ipv6 = 1 设置生效 sysctl -p 查看没有IP ...

  7. CentOS7/6 关闭防火墙

    CentOS6关闭防火墙使用以下命令, //临时关闭 service iptables stop //禁止开机启动 chkconfig iptables off CentOS7中若使用同样的命令会报错 ...

  8. Centos7永久关闭防火墙

    Centos7永久关闭防火墙 查看防火墙状态: systemctl status firewalld.service 绿的running表示防火墙开启 执行关闭命令: systemctl stop f ...

  9. OpenWrt之关闭IPv6

    目录 OpenWrt之关闭IPv6 1.前言 2.WAN口设置 3.LAN口设置 4.保存并应用 5.防火墙设置 6.DHCP/DNS设置 1)SSH连接路由器 2)输入第一条命令,按回车执行 3)输 ...

随机推荐

  1. EntityFrameworkCore概览

    .NET Core 中 EntityFrameworkCore的支持库主要有: Script-migration 级联删除 protected override void OnConfiguring( ...

  2. fiddler抓取https-----重要

    原文地址https://www.cnblogs.com/joshua317/p/8670923.html 很多使用fiddler抓包,对于http来说不需太多纠结,随便设置下就能用,但是抓取https ...

  3. Xcode $(SRCROOT)和$(PROJECT_DIR)区别

    $(SRCROOT)代表的时项目根目录下 $(PROJECT_DIR)代表的是整个项目 PS:往项目添加文件时,例如.a等,要先show in finder ,复制到项目中,然后再拖到xcode项目中 ...

  4. SQL Server数据库(时间戳timestamp)类型

    1.公开数据库中自动生成的唯一二进制数字的数据类型. 2.timestamp 通常用作给表行加版本戳的机制. 3.存储大小为 8 个字节. 不可为空的 timestamp 列在语义上等价于 binar ...

  5. Nodejs【单机】多进程模式集群

    Nodejs[单机]多进程模式集群实例: 1.安装:npm install -s cluster 2.服务代码: var debug = require('debug'); var express = ...

  6. mybatis3 前台传数组 的处理

    /** * 分页按条件查询权限列表 * @param keywords * @return */ @RequestMapping(value = "/getByCondition2" ...

  7. kali漏洞扫描

    nmap (apt-get install nmap)          nmap从初级到高级 ------------------------------ Nessus (dpkg -i Nessu ...

  8. jQuery筛选--hasClass(class)和eq(index|-index)

    hasClass(class) 概述 检查当前的元素是否含有某个特定的类,如果有,则返回true 参数 class  用于匹配的类名 <!DOCTYPE html> <html> ...

  9. JavaScript 基础,登录验证

    1.<script></script>的三种用法: a.放在<body>中 b.放在<head>中 c.放在外部JS文件中 <!DOCTYPE h ...

  10. Spring 无缝整合 quartz

    关键步骤: 1. 配置 SchedulerFactoryBean <bean class="org.springframework.scheduling.quartz.Schedule ...