-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
ipv6nat stop working after docker update #33
Comments
I'm not sure where those errors come from, ipv6nat runs ip6tables, not iptables. It seems something else is going on here. I can take a look, but please give me your run command (or docker-compose section) for ipv6nat and output of both |
iptables-save:
ip6tables-save:
docker-compose.yml:
|
And this output is with ipv6nat running? Or did it exit at this time? I'm asking because you're using Can you do a |
I have removed the command section and run the recreate:
|
The ipv6nat wasn't running because it fails at the start with that log. |
OK, it craps out trying to detect hairpin mode in the IPv4 firewall. Could you try:
|
|
Can you try the same but with
|
The output is empty.
|
So when you're running I've just tried the same on a test host running Docker 19.03.0-beta3, and I still see the IPv4 rules from within the container, so no way to reproduce it on my end. |
Sorry I run the ip6tables command.
|
Sorry, I'm a bit confused, this output is different than before again. Can you please post all 3 outputs:
All commands use |
Despite my provider give me only a /128 block, it seems I can have a /64 block anyway. I have reconfigured my docker to handle ipv6 block /80. Also, an issue is that they are no ipv6 isolation of the container. If I have a port listing (80) on a container but I don't open it on the host (don't have the "ports"), I can't reach it with ipv4, but I can with ipv6. The ipv6 nat is far easier to configure. Here the output I have (sorry for the change):
|
well, ipv6 sucks with docker. I will disable ipv6 on my host. It is not really useful. |
Yeah, it does suck big time. However, I've been running it with ipv6nat for years without any issues. Not sure what your issue is; your container not being able to reach the (IPv4) firewall rules seems to be the cause of ipv6nat crashing, but why this is happening I don't know. Are you by any chance using SELinux? I can't reproduce it myself, so it's hard to debug. |
I'm on debian/buster, the latest kernel on this system. |
Yeah, I'm curious to know what's causing it. Even on 19.03.0-beta3 I could not reproduce it, so it must not be a Docker thing. Perhaps it's something kernel-related. |
Can you test it with debian/buster ? |
Maybe it would be possible and safer to run your companion on the host directly? Something like a service that starts with docker? |
The kernel:
|
Running on the host is a great idea, that should work since it should be able to access the firewall there. I'll try to do some tests with buster / later kernels soon. |
OK @celogeek, just did 2 clean Debian VM installs (1 stretch @ 4.9.0-9, 1 buster @ 4.19.0-5) and installed Docker stable (18.09.6). Then tried reading iptables from within a (privileged, net=host) container on both:
It seems the problem is buster using nftables (see https://wiki.debian.org/nftables). I managed to get it working by switching to legacy version by running:
After the reboot, I can see the rules from inside the container again. |
Nice catch! Did you try directly on the host? without a container? |
Yes, you can either switch to legacy iptables like above, or run ipv6nat directly on the host. On the host it will use the iptables/ip6tables commands that are linked to the special nftables compatibility versions. This same approach would also work from within the container (auto translating iptables to nftables), so I'm working on a fix for the Docker image to support this. I just need to figure out how to reliably detect which is used. After I'm done with this fix, you should be able to run it again as a container, without any changes. |
Hi @celogeek , just released a new version of the docker images with support for nftables, so it should work again with your previous setup, unchanged. Could you test this? |
Yes of course. I guess you have try in debian/buster/nfptables condition ? |
Yep, tried it and as far as I could see it starts just fine. |
test done here the error I got:
in dmesg:
Maybe used ip6tables-nft instead? |
Yeah, I'm seeing this same error now. Seems like a bug in the compat scripts, because we're obviously using protocol 6. Doing an You're right about |
Wait, this is great, there's a Alpine ip6tables 1.8.2-r1 package in edge now, built just YESTERDAY 😄 I'll go check it out. |
I got a bit further by using 1.8.1-r1 and There's not really a workaround with the current version, so I'll fix the issue to get it working. Should be done soon, I'll let you know. I'll reopen this issue. |
@celogeek Could you please test again with the latest release? Thanks! |
yes sure. testing it right now. |
It works !!! congrat. Everything is back to normal now. I will take a vps with ipv6 connectivity and play with real ipv6 config (no nat). This would be a good challenge ;) A very great companion for docker would be something like this tools, that disable incoming connection and redirect port to the one inside but with real ipv6 ip addr. As I said before if I have a real ipv6 on a docker, it is accessible directly without following the rules of dockers (port open/close or redirected). |
Good to hear it's working! I'll close the issue now. |
Hi,
I have got this error since my docker upgrade:
My docker version:
My nat table:
I have disabled ipv6 for now. Can I do something to fix this?
thanks
The text was updated successfully, but these errors were encountered: