Linux mint disable ipv6

📑 Как отключить IPV6 в Ubuntu/Mint

IPV6 — протокол будущего. С этим никто не спорит. Переход на протокол IPv6 со старой версии IPv4 продиктован в первую очередь острой нехваткой интернет-адресов в рамках IPv4. IPv4 использует 32-битную адресацию и может поддерживать 4.3 миллиарда устройств, подключенных к интернету, в то время как IPv6 работает со 128-битной адресацией и теоретически может поддерживать работу в сети значительно большего количества устройств.

Но в настоящее время IPV6 мало кто использует и, думается, что лет двадцать он так и останется протоколом будущего. Однако в интернете уже давно ходят статьи об опасности протокола. Вернее не протокола, а того, что даже при наличии возможности IPV6 администраторы его не мониторят и не ставят по нему защиту.

Даже если он не включен на роутере, то на Ubuntu он присутствует по умолчанию. И иногда подтормаживает и приводит к некоторым сбоям.

Например, при работе с NetworkManager-ом и включенным автоматом IPV6 приходилось наблюдать сложности про коннекте к cети по Wifi. Причем при установке в настройке IPV6 опции «Игнорировать» эти чудеса пропадали.

Поэтому рекомендуется — если не работаете с IPV6, то отключайте его. Именно отключайте, с возможностью снова быстро включить.

Сначала проверяем есть ли IPV6:

Для отключения IPv6 в Ubuntu/Mint нужно отредактировать файл /etc/sysctl.conf. Для этого любимым редактором (например, nano) открываем его:

и в конец файла дописываем строчки:

Затем для того, чтобы настройки вступили в силу набрать команду:

а лучше всего перегрузить компьютер. И получим:

Для включения IPV6 нужно или удалить эти строки, или установить все значения в 0.

Источник

linux

Как отключить IP версии 6 в Linux

  • Получить ссылку
  • Facebook
  • Twitter
  • Pinterest
  • Электронная почта
  • Другие приложения

IPv6 далеко не всегда может использоваться в системе. Более того, он может вызвать некоторые проблемы при обращении к локальной петле (127.0.0.1) — запросы могут пойти на адрес ::1, что может привести к тому, что некоторые приложения будут работать не корректно.

В данной инструкции используются универсальные методы, которые подойдут для различных систем, например, Ubuntu, CentOS, Debian, Red Hat и так далее.

Быстрее всего отключить IPv6 через настройку ядра. Это универсальный способ и он подойдет для многих дистрибутивов на базе Linux.
Глобально (для всех интерфейсов)

Создаем или открываем файл:

* 99-sysctl.conf является основным конфигурационным файлом, а 10-ipv6-privacy.conf в каталоге sysctl.d — дополнительным. Для удобства лучше использовать последний.

Добавляем следующие строки:

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6=1
Применяем настройки.

Если вносили изменения в файл /etc/sysctl.d/99-sysctl.conf:

Если вносили изменения в файл /etc/sysctl.d/10-ipv6-privacy.conf:

sysctl -p /etc/sysctl.d/10-ipv6-privacy.conf

Перезапускаем сетевые настройки:

systemctl restart network || systemctl restart networking || systemctl restart NetworkManager

* в deb линуксах используется имя для службы networking, в RPM — network; в CentOS 8 перезапускается NetworkManager.

Смотрим — должны остаться только адреса IPv4:

ip a
Для определенного интерфейса

Если нужно отключить IPv6 только для одного интерфейса, например, для eth0, также открываем настройку ядра.

* где eth0 наш интерфейс, для которого мы хотим отключить IPv6.

sysctl -p /etc/sysctl.d/10-ipv6-privacy.conf

Перезапускаем настройки сети:

systemctl restart network || systemctl restart networking || systemctl restart NetworkManager
Через GRUB

Потенциально, это опасный метод, так как неправильная настройка загрузчика может привести к ошибке запуска системы. Однако, данный метод кому-то может понадобиться.

Открываем конфигурационный файл загрузчика:

GRUB_CMDLINE_LINUX=»ipv6.disable=1 crashkernel=auto rhgb quiet»

Источник

How to disable Ipv6 on Ubuntu, Linux Mint, Debian

Ipv6 is the next version of the addressing scheme Ipv4 that is currently being used to assign numerical address to domain names like google.com over the internet.

Ipv6 allows for more addresses than what Ipv4 supports. However it is not yet widely supported and its adoption is still in progress.

Check if your system supports ipv6 ?

Check out http://testmyipv6.com/ to see if you network supports Ipv6.

For Ipv6 to work you need —

1. An OS that supports IPv6. Ubuntu and most modern Linuxes do that.
2. Your network hardware (router/modem) must support Ipv6. Many of the good brands do.
3. Your ISP must also support IPv6. This is something that is not present everywhere !

Читайте также:  Windows error recovery как исправить

Check the output of ifconfig command to see the «inet6 addr» line.

Problems if ipv6 not supported

So if ipv6 is not supported on your network infrastructure, it might be useful to disable it all together. It can cause issues like delayed domain lookups, un-necessary attempts to connect to ipv6 addresses causing delay in network connection etc.

I did come across some problems like that. The apt-get command occasionally tries to connect to ipv6 addresses and fails and then retries an ipv4 address. Take a look at this output

Errors like those have been more frequent in the recent Ubuntu versions, probably because they try to use Ipv6 more than before.

I noticed similar issues happen in other applications like Hexchat and also Google Chrome which would sometimes take longer than usual to lookup a domain name.

So the best solution is to disable Ipv6 entirely to get rid of those things. It takes only a small configuration and can help you solve many network issues on your system. Users have even reported an increase in internet speed.

Method 1 — Disable Ipv6 from sysctl

The first method to disable Ipv6 is to edit kernel level parameters via sysctl interface.
The kernel parameters that enable ipv6 are as follows

Note that the variables control «disabling» of ipv6. So setting them to 1 would disable ipv6
Edit the file — /etc/sysctl.conf

And fill in the following lines at the end of that file

Save the file and close it. Restart sysctl with

Check the output of ifconfig again and there should be no ipv6 address

If it does not work, then try rebooting the system and check ifconfig again.

Method 2 : Disable ipv6 from GRUB

Ipv6 can also be disabled by editing the grub configuration file

Look for the line containing «GRUB_CMDLINE_LINUX» and edit it as follows

The same can also be added to the value of the variable named «GRUB_CMDLINE_LINUX_DEFAULT» and either would work. Save the file, close it and regenerate the grub configuration

Reboot. Now ipv6 should be disabled.

A Tech Enthusiast, Blogger, Linux Fan and a Software Developer. Writes about Computer hardware, Linux and Open Source software and coding in Python, Php and Javascript. He can be reached at [email protected] .

13 thoughts on “ How to disable Ipv6 on Ubuntu, Linux Mint, Debian ”

Thanks! Fixed my network issue. All of a sudden, Mint 18 had network issue. Most sites in Firefox would not work. When I checked, the IP was an IPV6 address, not the IPV4 I expected. Added your lines and all is good.

Mint 18 doesn’t have gedit. The default editor is Xed. Yes, I’m a noob and I had to use Google to figure it out.

Thanks for the explanation! Even 4 years latter it still helps.

thanks for the comment.
glad that your network issue was resolved.

Also for disabling it from linux kernel.
Find if its installed, lsmod list the modules:

Remove it with rmmode:

Thank you. I’m a super noob and this is the first thing I read and applied as far as linux that actually worked with no problems.

Hi.
On Linux Mint 17.2 or 17.3 when I try to use GRUB method I recieve error message after try to update GRUB !! I follow instructions above & change variables in configration file then “save” changes. But when I use:

sudo update-grub
then I recieved error message !!

I try sudo update-grub2
but It is not available !! Are you sure it is grub2 not grub ? I think it is just grub

I try to invistigate this by just type in terminal:

to see what output. Then I recieved message say “grub not installed” & command me to use:

sudo apt-get install grub

Please your kind reply.

I think you’re using Lilo not Grub. or something else. Please refer to this
http://askubuntu.com/questions/107440/how-to-check-what-bootloader-my-system-is-using
to check your system bootloader

Disbaling IPv6 solved the issue of all google sites loading slowly for me.

It’s suffice with just net.ipv6.conf.all.disable_ipv6 = 1
That will automatically imply net.ipv6.conf.*.disable_ipv6 = 1

Thanks for pointing out.

Edit /etc/gai.conf and uncomment the line to prefer ipv4 over ipv6.

Which is the correct way to deal with this.

Sorry but, how do you save the file? xD i mean i’m sorry i’m trying to learn.. I have Mint 17 cinammon

Читайте также:  Dell драйвера для линукс

This does not work for me. $ sudo gedit /etc/default/grub. Will not recognize $ sudo. I’m running Mint 17 KDE. I was able to bring up the command to notice that I have the ipv6 running; but my ISP and the modem is not running it. How should I disable it in KDE?

dont use the dollar sign ($), it just indicates the terminal prompt
type in from “sudo …” onwards

Источник

Как отключить IPv6 в Ubuntu

Протокол IPv6 — это новая технология, которая предоставляет намного большее адресное пространство IP адресов, более высокую безопасность и скорость работы. Но это все в идеале. IPv6 нарушает обратную совместимость с IPv4 и сейчас в большинстве случаев используется старый протокол. Мы уже очень подробно рассматривали чем отличается IPv6 от IPv4, поэтому не будем повторять все еще раз.

Поскольку на данный момент IPv6 используется достаточно редко, этот протокол полностью поддерживается далеко не всем оборудованием. Если IPv6 не поддерживается вашим роутером или провайдером, то это замедлит работу сети, дольше будут определяться доменные имена сайтов и будет выполняться попытка получения IPv6 адреса, что тоже приведет к задержке. В этой небольшой заметке мы рассмотрим как отключить IPv6 в Ubuntu или других совместимых дистрибутивах.

Проверка поддержки IPv6

Все современные дистрибутивы поддерживают IPv6 без исключений. Но чтобы убедиться что ваша локальная машина получила ipv6 адрес вы можете выполнить команду:

В разделе для подключения eth0 вы увидите адрес inet4 и inet6, в inet6 будет показан адрес Ipv6, который присвоен этому компьютеру роутером. Все адреса, начинающиеся с fe80 — это адреса локальных сетей. Но присутствие этого адреса еще не означает, что он поддерживается вашим провайдером. Для проверки этого пункта можно попытаться отправить ping запрос на ipv6.google.com:

Если вы увидите привычный ответ о времени доставки пакетов, то значит все работает, но если ipv6 провайдером не поддерживается вы получите network unreachable или что-то в этом роде. В таком случае IPv6 лучше отключить чтобы интернет работал быстрее.

Как отключить IPv6 в Ubuntu

Есть несколько способов отключить IPv6 Ubuntu мы рассмотрим их все.

Способ 1. С помощью sysctl

Первый способ решения нашей задачи, это редактирование параметров ядра во время выполнения с помощью sysctl. Для отключения IPv6 выполните:

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

Вы можете также пойти другим путем и записать все эти значения в файл настройки, чтобы они применялись по умолчанию при старте системы:

sudo vi /etc/sysctl.conf

net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

Сохраните файл, закройте его и перезапустите sysctl для обновления конфигурации:

Теперь, когда вы выполните ip addr show, здесь не должно быть ipv6 адреса:

Способ 2. Отключить ipv6 в Grub

Вы также можете отключить IPv6 отредактировав параметры загрузки ядра в Grub. Для этого откройте файл /etc/default/grub и добавьте туда такую строку:

sudo vi /etc/default/grub

GRUB_CMDLINE_LINUX = «ipv6.disable = 1»

Если переменная GRUB_CMDLINE_LINUX уже существует то вы можете добавить это значение в конец строки к другим параметрам. После завершения сохраните изменения и обновите конфигурацию Grub с помощью команды:

После перезагрузки отключение ipv6 Ubuntu 16.04 будет завершено и ваша сеть станет работать быстрее.

Выводы

В этой статье мы рассмотрели как отключить ipv6 linux как видите, это очень просто. Возможно, вы и не знали раньше, но если ваш провайдер не поддерживает этот протокол, то его лучше отключить.

Источник

How to Disable IPv6 on Ubuntu Linux

Last updated October 29, 2020 By Sergiu 21 Comments

Are you looking for a way to disable IPv6 connections on your Ubuntu machine? In this article, I’ll teach you exactly how to do it and why you would consider this option. I’ll also show you how to enable or re-enable IPv6 in case you change your mind.

What is IPv6 and why would you want to disable IPv6 on Ubuntu?

Internet Protocol version 6 (IPv6) is the most recent version of the Internet Protocol (IP), the communications protocol that provides an identification and location system for computers on networks and routes traffic across the Internet. It was developed in 1998 to replace the IPv4 protocol.

IPv6 aims to improve security and performance, while also making sure we don’t run out of addresses. It assigns unique addresses globally to every device, storing them in 128-bits, compared to just 32-bits used by IPv4.

Although the goal is for IPv4 to be replaced by IPv6, there is still a long way to go. Less than 30% of the sites on the Internet makes IPv6 connectivity available to users (tracked by Google here). IPv6 can also cause problems with some applications at time.

Читайте также:  Долгая загрузка проводника windows 10

Since VPNs provide global services, the fact that IPv6 uses globally routed addresses (uniquely assigned) and that there (still) are ISPs that don’t offer IPv6 support shifts this feature lower down their priority list. This way, they can focus on what matters the most for VPN users: security.

Another possible reason you might want to disable IPv6 on your system is not wanting to expose yourself to various threats. Although IPv6 itself is safer than IPv4, the risks I am referring to are of another nature. If you aren’t actively using IPv6 and its features, having IPv6 enabled leaves you vulnerable to various attacks, offering the hacker another possible exploitable tool.

On the same note, configuring basic network rules is not enough. You have to pay the same level of attention to tweaking your IPv6 configuration as you do for IPv4. This can prove to be quite a hassle to do (and also to maintain). With IPv6 comes a suite of problems different to those of IPv4 (many of which can be referenced online, given the age of this protocol), giving your system another layer of complexity.

It has also been observed that disabling IPv6 helps to improve WiFi speed in Ubuntu in some cases.

Disabling IPv6 on Ubuntu [For Advanced Users Only]

In this section, I’ll be covering how you can disable IPv6 protocol on your Ubuntu machine. Open up a terminal (default: CTRL+ALT+T) and let’s get to it!

Note: For most of the commands you are going to input in the terminal you are going to need root privileges (sudo).

If you are a regular desktop Linux user and prefer a stable working system, please avoid this tutorial. This is for advanced users who know what they are doing and why they are doing so.

1. Disable IPv6 using Sysctl

First of all, you need to make sure that you have IPv6 enabled on your system. Check your IP address in Ubuntu with this command:

You should see an IPv6 address if it is enabled (the name of your internet card might be different):

You have see the sysctl command in the tutorial about restarting network in Ubuntu. We are going to use it here as well. To disable IPv6 you only have to input 3 commands:

You can check if it worked using:

You should see no IPv6 entry:

However, this only temporarily disables IPv6. The next time your system boots, IPv6 will be enabled again.

One method to make this option persist is modifying /etc/sysctl.conf. I’ll be using vim to edit the file, but you can use any editor you like. Make sure you have administrator rights (use sudo):

Add the following lines to the file:

For the settings to take effect use:

If IPv6 is still enabled after rebooting, you must create (with root privileges) the file /etc/rc.local and fill it with:

Now use chmod command to make the file executable:

What this will do is manually read (during the boot time) the kernel parameters from your sysctl configuration file.

2. Disable IPv6 using GRUB

An alternative method is to configure GRUB to pass kernel parameters at boot time. You’ll have to edit /etc/default/grub. Once again, make sure you have administrator privileges:

Grub Configuration 1

Now you need to modify GRUB_CMDLINE_LINUX_DEFAULT and GRUB_CMDLINE_LINUX to disable IPv6 on boot:

Save the file and run the update-grub command:

The settings should now persist on reboot.

Re-enabling IPv6 on Ubuntu

To re-enable IPv6, you’ll have to undo the changes you made. To enable IPv6 until reboot, enter:

Otherwise, if you modified /etc/sysctl.conf you can either remove the lines you added or change them to:

You can optionally reload these values:

You should once again see a IPv6 address:

Optionally, you can remove /etc/rc.local:

If you modified the kernel parameters in /etc/default/grub, go ahead and delete the added options:

Wrapping Up

In this guide I provided you ways in which you can disable IPv6 on Linux, as well as giving you an idea about what IPv6 is and why you would want to disable it.

Did you find this article useful? Do you disable IPv6 connectivity? Let us know in the comment section!

Like what you read? Please share it with others.

Источник

Оцените статью