pkg/mesh: enable outgoing NAT to WAN
This commit enables NAT-ing packets outgoing to the WAN from both the Pod subnet as well as from peers. This means that Pods can access the Internet and that peers can use the Kilo mesh as a gateway to the Internet. Signed-off-by: Lucas Servén Marín <lserven@gmail.com>
This commit is contained in:
@@ -273,21 +273,6 @@ func (c *Controller) CleanUp() error {
|
||||
return c.deleteFromIndex(0, &c.rules)
|
||||
}
|
||||
|
||||
// ForwardRules returns a set of iptables rules that are necessary
|
||||
// when traffic must be forwarded for the overlay.
|
||||
func ForwardRules(subnets ...*net.IPNet) []Rule {
|
||||
var rules []Rule
|
||||
for _, subnet := range subnets {
|
||||
s := subnet.String()
|
||||
rules = append(rules, []Rule{
|
||||
// Forward traffic to and from the overlay.
|
||||
&rule{"filter", "FORWARD", []string{"-s", s, "-j", "ACCEPT"}},
|
||||
&rule{"filter", "FORWARD", []string{"-d", s, "-j", "ACCEPT"}},
|
||||
}...)
|
||||
}
|
||||
return rules
|
||||
}
|
||||
|
||||
func nonBlockingSend(errors chan<- error, err error) {
|
||||
select {
|
||||
case errors <- err:
|
||||
|
Reference in New Issue
Block a user