温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Linux 系统怎么禁用IPV6

发布时间:2022-01-21 10:17:21 来源:亿速云 阅读:134 作者:kk 栏目:开发技术

今天就跟大家聊聊有关Linux 系统怎么禁用IPV6,可能很多人都不太了解,为了让大家更加了解,小编给大家总结了以下内容,希望大家根据这篇文章可以有所收获。

IPv6早在上个世纪90年代,它就已经诞生了。IPv6全称Internet Protocol version 6,是网际协议的最新版本,用作互联网的协议。用它来取代IPv4主要是为了解决IPv4地址枯竭问题,同时它也在其他方面对于IPv4有许多改进。

是否应该“启用或者关闭”IPV6协议并不是一个很容易回答的问题。这就象是一片灰色地带,充满了各种各样的观点。如果你想要关闭的话,这篇可以来学习一下,本文档以实战的形式介绍 Linux 系统如何禁用 IPV6, 文内含长段代码可复制可往左滑,希望对大家有帮助!

环  境

RHEL7.3

更改/etc/sysctl.conf配置文件

[root@liangxu]# vim /etc/sysctl.conf # sysctl settings are defined through files in# /usr/lib/sysctl.d/, /run/sysctl.d/, and /etc/sysctl.d/.## Vendors settings live in /usr/lib/sysctl.d/.# To override a whole file, create a new file with the same in# /etc/sysctl.d/ and put new settings there. To override# only specific settings, add a file with a lexically later# name in /etc/sysctl.d/ and put new settings there.## For more information, see sysctl.conf(5) and sysctl.d(5).net.ipv6.conf.all.disable_ipv6 = 1net.ipv6.conf.default.disable_ipv6 = 1[root@liangxu]# ifconfig# IPV6 字段 inet6 fe80::250:56ff:fe22:db62ens33: flags=4163mtu 1500        inet 192.168.10.11  netmask 255.255.255.0  broadcast 192.168.10.255        inet6 fe80::250:56ff:fe22:db62  prefixlen 64  scopeid 0x20        ether 00:50:56:22:db:62  txqueuelen 1000  (Ethernet)        RX packets 11717  bytes 4355183 (4.1 MiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 6943  bytes 2011730 (1.9 MiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73mtu 65536        inet 127.0.0.1  netmask 255.0.0.0        inet6 ::1  prefixlen 128  scopeid 0x10        loop  txqueuelen 1  (Local Loopback)        RX packets 112  bytes 9492 (9.2 KiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 112  bytes 9492 (9.2 KiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0[root@liangxu]# sysctl -p  #让配置文件立即生效net.ipv6.conf.all.disable_ipv6 = 1net.ipv6.conf.default.disable_ipv6 = 1[root@liangxu]# ifconfig # IPV6 字段已经消失ens33: flags=4163mtu 1500        inet 192.168.10.11  netmask 255.255.255.0  broadcast 192.168.10.255        ether 00:50:56:22:db:62  txqueuelen 1000  (Ethernet)        RX packets 11747  bytes 4357703 (4.1 MiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 6961  bytes 2014592 (1.9 MiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0lo: flags=73mtu 65536        inet 127.0.0.1  netmask 255.0.0.0        loop  txqueuelen 1  (Local Loopback)        RX packets 112  bytes 9492 (9.2 KiB)        RX errors 0  dropped 0  overruns 0  frame 0        TX packets 112  bytes 9492 (9.2 KiB)        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

什么是Linux系统

Linux是一种免费使用和自由传播的类UNIX操作系统,是一个基于POSIX的多用户、多任务、支持多线程和多CPU的操作系统,使用Linux能运行主要的Unix工具软件、应用程序和网络协议。

看完上述内容,你们对Linux 系统怎么禁用IPV6有进一步的了解吗?如果还想了解更多知识或者相关内容,请关注亿速云行业资讯频道,感谢大家的支持。

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI