moby / moby/libnetwork

iptables rules: respect ipsec traffic

Open
#430 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement status/1-needs-design-review
Dominant language
Go
Stars
2.2k
Forks
875
PR merge metrics
No merged PRs in 30d

Description

Docker using iptables ruins IPsec setup, because it masquerades packets that shouldn't be masqueraded. Please add -m policy --dir out --pol none to the POSTROUTING rule.

In detail: Docker creates a rule like the following.

-A POSTROUTING -s 172.16.62.0/24 ! -o docker0 -j MASQUERADE

Instead it should create

-I POSTROUTING -m policy --dir out --pol none -s 172.16.62.0/24 ! -o docker0 -j MASQUERADE

The code generating these is in libnetwork/drivers/bridge/setup_ip_tables.go. I can update the two iptables references, if you'd accept such a patch. I don't know and can't test the the other network provider unfortunately.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read libnetwork/drivers/bridge/setup_ip_tables.go and locate the two iptables references that generate the POSTROUTING rule. Compare their output with the examples in the issue; done means IPsec traffic is excluded from masquerading while the existing bridge rule behavior remains intact. No test file or runnable test is named in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
networking
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.