zoukankan      html  css  js  c++  java
  • CentOS7 彻底关闭 IPV6

    查看服务监听的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是否关闭。
     
  • 相关阅读:
    BZOJ2337 [HNOI2011]XOR和路径
    「学习笔记」3.31代码学习
    uva live 12846 A Daisy Puzzle Game
    Cannot use ImageField because Pillow is not installed
    Android点击Button水波纹效果
    hdu 1241 Oil Deposits
    c++ 字符输入读取
    clutter recoder
    C/C++获取数组长度
    vector array and normal stanard array
  • 原文地址:https://www.cnblogs.com/gavinyyb/p/8365377.html
Copyright © 2011-2022 走看看