You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+3
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,7 @@ By default, the agent is configured to reload its configuration from the `/etc/c
28
28
The agent configuration file should be written in yaml or json syntax, and may contain three optional keys:
29
29
-`nonMasqueradeCIDRs []string`: A list strings in CIDR notation that specify the non-masquerade ranges.
30
30
-`masqLinkLocal bool`: Whether to masquerade traffic to `169.254.0.0/16`. False by default.
31
+
-`masqLinkLocalIPv6 bool`: Whether to masquerade traffic to `fe80::/10`. False by default.
31
32
-`resyncInterval string`: The interval at which the agent attempts to reload config from disk. The syntax is any format accepted by Go's [time.ParseDuration](https://golang.org/pkg/time/#ParseDuration) function.
32
33
33
34
The agent will look for a config file in its container at `/etc/config/ip-masq-agent`. This file can be provided via a `ConfigMap`, plumbed into the container via a `ConfigMapVolumeSource`. As a result, the agent can be reconfigured in a live cluster by creating or editing this `ConfigMap`.
@@ -50,6 +51,8 @@ The agent accepts two flags, which may be specified in the yaml file.
50
51
`nomasq-all-reserved-ranges`
51
52
: Whether or not to masquerade all RFC reserved ranges when the configmap is empty. The default is `false`. When `false`, the agent will masquerade to every destination except the ranges reserved by RFC 1918 (namely `10.0.0.0/8`, `172.16.0.0/12`, and `192.168.0.0/16`). When `true`, the agent will masquerade to every destination that is not marked reserved by an RFC. The full list of ranges is (`10.0.0.0/8`, `172.16.0.0/12`, `192.168.0.0/16`, `100.64.0.0/10`, `192.0.0.0/24`, `192.0.2.0/24`, `192.88.99.0/24`, `198.18.0.0/15`, `198.51.100.0/24`, `203.0.113.0/24`, and `240.0.0.0/4`). Note however, that this list of ranges is overridden by specifying the nonMasqueradeCIDRs key in the agent configmap.
52
53
54
+
`enable-ipv6`
55
+
: Whether to configurate ip6tables rules. By default `enable-ipv6` is false.
53
56
54
57
## Rationale
55
58
(from the [incubator proposal](https://gist.github.com/mtaufen/253309166e7d5aa9e9b560600a438447))
Copy file name to clipboardExpand all lines: cmd/ip-masq-agent/ip-masq-agent.go
+102-13
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,8 @@ import (
39
39
40
40
const (
41
41
linkLocalCIDR="169.254.0.0/16"
42
+
// RFC 4291
43
+
linkLocalCIDRIPv6="fe80::/10"
42
44
// path to a yaml or json file
43
45
configPath="/etc/config/ip-masq-agent"
44
46
)
@@ -48,18 +50,21 @@ var (
48
50
masqChain utiliptables.Chain
49
51
masqChainFlag=flag.String("masq-chain", "IP-MASQ-AGENT", `Name of nat chain for iptables masquerade rules.`)
50
52
noMasqueradeAllReservedRangesFlag=flag.Bool("nomasq-all-reserved-ranges", false, "Whether to disable masquerade for all IPv4 ranges reserved by RFCs.")
53
+
enableIPv6=flag.Bool("enable-ipv6", false, "Whether to enable IPv6.")
// NOTE(mtaufen): iptables requires names to be <= 28 characters, and somehow prepending "-m comment --comment " to this string makes it think this condition is violated
275
340
// Feel free to dig around in iptables and see if you can figure out exactly why; I haven't had time to fully trace how it parses and handle subcommands.
276
341
// If you want to investigate, get the source via `git clone git://git.netfilter.org/iptables.git`, `git checkout v1.4.21` (the version I've seen this issue on,
0 commit comments