Skip to content

Enable IPv6 NAT#1992

Closed
wrridgwa wants to merge 70 commits into
moby:masterfrom
wrridgwa:25407-natIPv6
Closed

Enable IPv6 NAT#1992
wrridgwa wants to merge 70 commits into
moby:masterfrom
wrridgwa:25407-natIPv6

Conversation

@wrridgwa

Copy link
Copy Markdown
Contributor

This pull request addresses this open issue moby/moby#25407
Previously when IPv6 was enabled on Docker, ip6tables weren't manipulated to do Port Forwarding and IP masquerading. This PR addresses that in a way similar to the IPv4 implementation.

Relies on the following Moby PR to bring the EnableIPv6 flag through to libnetwork: moby/moby#35252

When combined with the Docker pull request, the fix can be verified after starting a container in bridge mode with port forwarding and IPv6 enabled:

  1. Compare the iptables -t nat -L command with the ip6tables -t nat -L command
  2. Compare iptables -t filter -L command with ip6tables -t filter -L command
  3. Ping6 from within a running container to an outside device.

sd-omkar and others added 30 commits October 19, 2017 12:23
…odule volume for the tests that need to run modprobe.

Signed-off-by: Billy Ridgway <[email protected]>
Signed-off-by: Billy Ridgway <[email protected]>
- Introduced back the Invalidate
- optimized the rebroadcast logic

Signed-off-by: Flavio Crisciani <[email protected]>
join/leave fixes:
 - when a node leaves the network will deletes all the other nodes entries but will keep track of its
   to make sure that other nodes if they are tcp syncing will be aware of them being deleted. (a node that
   did not yet receive the network leave will potentially tcp/sync)

add network reapTime, was not being set locally

Signed-off-by: Flavio Crisciani <[email protected]>
Before when a node was failing, all the nodes would bump the lamport time of all their
entries. This means that if a node flap, there will be a storm of update of all the entries.
This commit on the base of the previous logic guarantees that only the node that joins back
will readvertise its own entries, the other nodes won't need to advertise again.

Signed-off-by: Flavio Crisciani <[email protected]>
This reverts commit 99290ab.

Signed-off-by: Flavio Crisciani <[email protected]>
This reverts commit de61c2f.

Signed-off-by: Flavio Crisciani <[email protected]>
Remove the need for the wait group and avoid new
locks
Added utility to print the method name and the caller name

Signed-off-by: Flavio Crisciani <[email protected]>
Move the sandbox init logic into the go routine that handles
peer operations.
This is to avoid deadlocks in the use of the pMap.Lock for the
network

Signed-off-by: Flavio Crisciani <[email protected]>
This patch improves debugging for the resolver;

- prefix debug messages with `[resolver]` for easier finding in the daemon logs
- use `A` / `AAAA` for query-types in the logs instead of their numeric code
- add debug messages if the external DNS did not return a result
- print sucessful results (t.b.d.)

Signed-off-by: Sebastiaan van Stijn <[email protected]>
Fix case sensitivity issue
Update docker and runc vendors

Signed-off-by: Derek McGowan <[email protected]>
…So now there are twice as many port bindings.

Signed-off-by: Billy Ridgway <[email protected]>
…r bridge, setup_ip_tables, firewalld and iptables.

Signed-off-by: Billy Ridgway <[email protected]>
Signed-off-by: Billy Ridgway <[email protected]>
Refreshed the PR: moby#1585
Addressed comments suggesting to remove the IPAlias logic not anymore used

Signed-off-by: Flavio Crisciani <[email protected]>
The peerDbDelete was passing the wrong field to the underlay
Delete operation causing the mac entry to not being deleted
from the bridge on the overlay. This caused connectivity issue
when a container that before was remote was now scheduled
on the local node. The entry was such:
bridge fdb show | grep -i 02:42:0a:01:00:02
02:42:0a:01:00:02 dev vxlan0 master br0
02:42:0a:01:00:02 dev vxlan0 dst 172.31.14.63 link-netnsid 0 self permanent
That was still pointing to a remove node

Signed-off-by: Flavio Crisciani <[email protected]>
In the peerDelete the updateDB flag was always true
In the peerAdd the updateDB flag was always true except for
the initSandbox case. But now the initSandbox is handled by the
go routing of the peer operations, so we can move that flag
down and remove it from the top level functions

Signed-off-by: Flavio Crisciani <[email protected]>
Prevents an issue where the goroutine may jump to a new OS thread during
execution putting it into a mount/network NS that is unexpected.

Signed-off-by: Brian Goff <[email protected]>
(cherry picked from commit 65bb58f)
Signed-off-by: Brian Goff <[email protected]>
`/etc/resolv.conf` is not an essential file in filesystem. (see
http://man7.org/linux/man-pages/man5/resolv.conf.5.html)

> If this file does not exist, only the name server on the local machine
> will be queried

It's baffling to users that containers can start with an empty
`resolv.conf` but cannot without this file.

This PR:
* ignore this error and use default servers for containers in `bridge`
  mode networking.
* create an empty resolv.conf in `/var/lib/docker/containers/<id>` in
  `host` mode networking.

Signed-off-by: Yuanhong Peng <[email protected]>
The cluster provider interface does not need GetNetworkKeys
and SetNetworkKeys

Signed-off-by: Hui Kang <[email protected]>
Use the string concatenation operator instead of using Sprintf for
simple string concatenation. This is usually easier to read, and allows
the compiler to detect problems with the type or number of operands,
which would be runtime errors with Sprintf.

Signed-off-by: Aaron Lehmann <[email protected]>
Signed-off-by: Flavio Crisciani <[email protected]>
abhi and others added 11 commits October 19, 2017 12:27
Since bit allocation is no longer first available from
the start some verfications are removed/modified to
the change allocation model

Signed-off-by: Abhinandan Prativadi <[email protected]>
Signed-off-by: Abhinandan Prativadi <[email protected]>
Fix marshalling and add test

Signed-off-by: Flavio Crisciani <[email protected]>
Signed-off-by: Sebastiaan van Stijn <[email protected]>
Without `-n`, iptables will attempt to lookup hostnames for IP
addresses, which can slow down the call dramatically.
Since we don't need this, and generally don't even care about the
output, use the `-n` flag to disable this.

Signed-off-by: Brian Goff <[email protected]>
In case of merge commit, the sha passed to the codecov tool
is the one of the merged commit intstead of the merge commit
this creates error because the base commit is always different.
Passing it explicitely should fix it

Signed-off-by: Flavio Crisciani <[email protected]>
…ing runs before v6 and the userland proxy is up already. Complete FIXME for appending rule to FORWARD chain for IPv6.

Signed-off-by: Billy Ridgway <[email protected]>
@codecov-io

codecov-io commented Oct 19, 2017

Copy link
Copy Markdown

Codecov Report

❗ No coverage uploaded for pull request base (master@460ac8f). Click here to learn what that means.
The diff coverage is 37.13%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master    #1992   +/-   ##
=========================================
  Coverage          ?   38.34%           
=========================================
  Files             ?      137           
  Lines             ?    27552           
  Branches          ?        0           
=========================================
  Hits              ?    10565           
  Misses            ?    15698           
  Partials          ?     1289
Impacted Files Coverage Δ
resolver_unix.go 18.84% <0%> (ø)
drivers/overlay/filter.go 0% <0%> (ø)
drivers/bridge/setup_firewalld.go 58.82% <0%> (ø)
service_linux.go 3.38% <0%> (ø)
drivers/overlay/encryption.go 0% <0%> (ø)
drivers/bridge/setup_ip_forwarding.go 40.62% <33.33%> (ø)
drivers/bridge/setup_ip_tables.go 47.81% <38.05%> (ø)
drivers/bridge/bridge.go 52.42% <40.74%> (ø)
iptables/iptables.go 55% <54.83%> (ø)
portmapper/mapper.go 75% <57.14%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 460ac8f...136921d. Read the comment docs.

Comment thread drivers/bridge/port_mapping.go Outdated
var (
defaultBindingIP = net.IPv4(0, 0, 0, 0)
defaultBindingIP = net.IPv4(0, 0, 0, 0)
defaultBindingIPV6 = net.ParseIP("::1")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about ::1? This is localhost in IPv6 where 0.0.0.0 means any address in IPv4.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, you are right. This should be ::.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🕺 awesome! 👍

@wrridgwa

Copy link
Copy Markdown
Contributor Author

What can I do to move this pull request forward?

@fcrisciani

Copy link
Copy Markdown

@wrridgwa I would start with rebasing on top of latest master and squash all your changes into a single commit, right now the PR has a lot of extra stuff

@wrridgwa

Copy link
Copy Markdown
Contributor Author

@fcrisciani Should I just create a new pull request and put all of my stuff into one commit? Because of the commit signing issue that I ran into initially and the fact that my commits aren't all next to each other, its going to be hard to clean this up.

@wrridgwa

Copy link
Copy Markdown
Contributor Author

@fcrisciani I created a new pull request which is much cleaner: #2023

@antoineco

Copy link
Copy Markdown

@wrridgwa could you please close this for clarity?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.