Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot disable IPV6 in ubuntu WSL2 1.0.0 #9211

Closed
1 of 2 tasks
peterjuras opened this issue Nov 25, 2022 · 6 comments
Closed
1 of 2 tasks

Cannot disable IPV6 in ubuntu WSL2 1.0.0 #9211

peterjuras opened this issue Nov 25, 2022 · 6 comments
Labels

Comments

@peterjuras
Copy link

Version

Windows version: 10.0.22621.819

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.74.2

Distro Version

Ubuntu 22.04.1 LTS

Other Software

No response

Repro Steps

  1. Add the following lines to /etc/sysctl.conf
    net.ipv6.conf.all.disable_ipv6=1
    net.ipv6.conf.default.disable_ipv6=1
    net.ipv6.conf.lo.disable_ipv6=1
  2. Disable all IPV6 checkboxes for all network adapters in the control panel
  3. Reboot system

Expected Behavior

The ubuntu command: ip addr should no longer show an IPV6 address for eth0.

This breaks my docker desktop setup because containers can't communicate with each other. How can I disable IPV6 addresses for ubuntu in WSL2?

Actual Behavior

It still has a ipv6 address.

Diagnostic Logs

No response

@NiKiZe
Copy link

NiKiZe commented Nov 25, 2022

Suggestion Fix your setup properly instead.

@peterjuras
Copy link
Author

I'm using docker-compose to run multiple containers that aim to connect to each other, with the help of docker-host.

This doesn't work when there's an IPV6 address assigned, since docker can't handle it. How would you suggest to fix my setup?

@miyurusankalpa
Copy link

open a issue on https://github.com/qoomon/docker-host

IPv6 works fine on docker.

@NiKiZe
Copy link

NiKiZe commented Nov 26, 2022

I'm using docker-compose to run multiple containers that aim to connect to each other, with the help of docker-host.

This doesn't work when there's an IPV6 address assigned, since docker can't handle it. How would you suggest to fix my setup?

If software don't work when IPv6 is available on host, then it is just horrible broken. Disabling IPv6 is unacceptable.

If software don't work with IPv6 then it needs to be fixed. IPv4 is dead, what we need is ways to remove IPv4 from hosts.

@OneBlue
Copy link
Collaborator

OneBlue commented Nov 29, 2022

@peterjuras: sysctl.conf isn't applied by WSL so changes in that files won't have any effect.

One way to disable ipv6 globally would be to add:

[wsl2]
kernelCommandLine=ipv6.disable=1

In %USERPROFILE%/.wslconfig

(you'll need to run wsl.exe --shutdown to restart WSL after making the change).

@peterjuras
Copy link
Author

Thanks @OneBlue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants