In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article is to share with you about how to disable IPv6 in Ubuntu, the editor thinks it is very practical, so I share it with you to learn. I hope you can get something after reading this article.
What is IPv6? Why would you want to disable it?
Internet Protocol version 6 Internet Protocol version 6 (IPv6) is the latest version of Internet Protocol (IP). Internet protocol is a kind of communication protocol, which provides identification and positioning system for computers on the network, and routes communications on the Internet. IPv6 was designed in 1998 to replace the IPv4 protocol.
IPv6 is intended to improve security and performance while ensuring that addresses are not exhausted; it assigns unique 128bit addresses to each device globally, while IPv4 uses only 32 bits.
Although IPv6 aims to replace IPv4, there is still a long way to go; less than 30% of websites on the Internet support IPv6 (here is Google's statistics), and IPv6 sometimes causes problems for some applications.
Due to the fact that IPv6 uses global (only assigned) routing addresses, and (still) the fact that IPv6 is not supported by Internet service provider Internet Service Provider (ISP), IPv6 is low on the priority list of virtual private network (Virtual Private Network) providers that provide global services, so that they can focus on the most important thing for VPN users: security.
Not wanting to expose yourself to various threats may be another reason why you want to disable IPv6 on your system. Although IPv6 itself is more secure than IPv4, the risk I am referring to is of a different nature. If you don't actually use IPv6 and its functions, then enabling IPv6 will make you vulnerable to all kinds of attacks, thus providing another possible tool for hackers.
Again, it's not enough to configure basic network rules; you have to pay the same attention to adjusting the configuration of IPv6 as you do with IPv4, which can be quite a hassle (and maintenance). And with IPv6 there will be a different set of questions than IPv4 (given the age of the protocol, many of them can already be found online), which will add another layer of complexity to your system.
It has been observed that in some cases, disabling IPv6 can help increase the WiFi speed of Ubuntu.
Disable IPv6 on Ubuntu [advanced users]
In this section, I will elaborate on how to disable the IPv6 protocol on Ubuntu. Please open the terminal (default shortcut key: CTRL+ALT+T) and let's get started!
Note: most of the following commands entered into the terminal require root authority (sudo).
Warning!
If you are a regular Linux desktop user and prefer a stable working system, please avoid this tutorial, and the following section is for users who know what they are doing and why.
1. Disable IPv6 using sysctl
First, you can execute the following command to check if IPv6 is enabled:
Ip a
If enabled, you should see an IPv6 address (the name of the network card may be different from that in the figure)
IPv6 Address Ubuntu
IPv6 Address Ubuntu in the tutorial "restart the Network in Ubuntu" (LCTT Note: actually, this article does not mention the method of using sysctl.) You've seen the sysctl command, and we'll use it here as well. To disable IPv6, you only need to enter three commands:
Sudo sysctl-w net.ipv6.conf.all.disable_ipv6=1 sudo sysctl-w net.ipv6.conf.default.disable_ipv6=1 sudo sysctl-w net.ipv6.conf.lo.disable_ipv6=1
Check that the command is in effect:
Ip a
If the command takes effect, you should find that the entry for IPv6 disappears:
IPv6 Disabled Ubuntu
However, this method can only temporarily disable IPv6, so IPv6 will still be enabled the next time the system boots.
(LCTT translation note: temporary disable means that the changes made this time are in effect until the shutdown, because the relevant parameters are stored in memory and can be changed, but will be lost after the memory is powered off; in this sense, the two methods described below are temporary, but the time to change the parameter values is in the early stage of system startup, and it is applied every time the system starts. So how to achieve a permanent change in this sense? The answer is to disable the relevant features when compiling the kernel, and then regret that you have no choice but to recompile the kernel.)
One way to keep the options in effect is to modify the file / etc/sysctl.conf, where I use vim to edit the file, but you can use any editor you want, and make sure you have administrator privileges (with sudo):
Sysctl Configuration
Add the following lines (the same parameters you used previously) to the file:
Net.ipv6.conf.all.disable_ipv6=1 net.ipv6.conf.default.disable_ipv6=1 net.ipv6.conf.lo.disable_ipv6=1
Execute the following command to apply the settings:
Sudo sysctl-p
If IPv6 is still enabled after a restart and you want to continue with this method, you must (use root permissions) to create the file / etc/rc.local and add the following:
#! / bin/bash # / etc/rc.local / etc/sysctl.d / etc/init.d/procps restart exit 0
Then use the chmod command to change the file permissions to make them executable:
Sudo chmod 755 / etc/rc.local
This allows the system (at startup) to read kernel parameters from the previously edited sysctl configuration file.
two。 Disable IPv6 using GRUB
Another way is to configure GRUB, which passes parameters to the kernel at system startup. Doing so requires editing the file / etc/default/grub (make sure you have administrator privileges).
GRUB Configuration
Now you need to modify the two lines in the file that begin with GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX respectively to disable IPv6 at startup:
GRUB_CMDLINE_LINUX_DEFAULT= "quiet splash ipv6.disable=1" GRUB_CMDLINE_LINUX= "ipv6.disable=1"
(LCTT translation note: this refers to the addition of the parameter ipv6.disable=1 within the above two lines, which may have different default values in different systems.)
Save the file and execute the command:
Sudo update-grub
(LCTT translation note: this command is used to update the configuration file of GRUB, and sudo grub-mkconfig-o / boot/grub/grub.cfg is required on systems without the update-grub command)
The settings will take effect after the restart.
Re-enable IPv6 on Ubuntu
To re-enable IPv6, you need to undo all previous changes. However, if you just want to enable IPv6 temporarily, you can execute the following command:
Sudo sysctl-w net.ipv6.conf.all.disable_ipv6=0 sudo sysctl-w net.ipv6.conf.default.disable_ipv6=0 sudo sysctl-w net.ipv6.conf.lo.disable_ipv6=0
Otherwise, if you want to enable it continuously, see if / etc/sysctl.conf has been modified, you can delete the previous additions, or change them to the following values (the two methods are equivalent):
Net.ipv6.conf.all.disable_ipv6=0 net.ipv6.conf.default.disable_ipv6=0 net.ipv6.conf.lo.disable_ipv6=0
Then apply the settings (optional):
Sudo sysctl-p
(LCTT translation note: the optional meaning here may mean that if IPv6 was temporarily enabled before, there is no need to reload the configuration file.)
You should be able to see the IPv6 address again:
IPv6 Reenabled in Ubuntu
Alternatively, you can delete the previously created file / etc/rc.local (optional):
Sudo rm / etc/rc.local
If you modify the file / etc/default/grub, go back and delete the parameters you added:
GRUB_CMDLINE_LINUX_DEFAULT= "quiet splash" GRUB_CMDLINE_LINUX= ""
Then update the GRUB configuration file:
Sudo update-grub above is how to disable IPv6 in Ubuntu. The editor believes that there are some knowledge points that we may see or use in our daily work. I hope you can learn more from this article. For more details, please follow the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.