Skip to content

Commit

Permalink
Merge pull request #534 from alauda/fix/ipvs-host-svc
Browse files Browse the repository at this point in the history
fix: nat traffic that from host to svc
  • Loading branch information
oilbeater authored Nov 5, 2020
2 parents 08c187e + 2cf855e commit deef10a
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions pkg/daemon/gateway.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@ const (

var (
v4Rules = []util.IPTableRule{
// This rule makes sure we don't NAT traffic within overlay network
{Table: "nat", Chain: "POSTROUTING", Rule: strings.Split(`-m set --match-set ovn40subnets src -m set --match-set ovn40subnets dst -j RETURN`, " ")},
// Prevent performing Masquerade on external traffic which arrives from a Node that owns the Pod/Subnet IP
{Table: "nat", Chain: "POSTROUTING", Rule: strings.Split(`-m set ! --match-set ovn40subnets src -m set --match-set ovn40local-pod-ip-nat dst -j RETURN`, " ")},
{Table: "nat", Chain: "POSTROUTING", Rule: strings.Split(`-m set ! --match-set ovn40subnets src -m set --match-set ovn40subnets-nat dst -j RETURN`, " ")},
Expand All @@ -41,8 +39,6 @@ var (
{Table: "filter", Chain: "INPUT", Rule: strings.Split(`-m set --match-set ovn40subnets dst -j ACCEPT`, " ")},
}
v6Rules = []util.IPTableRule{
// This rule makes sure we don't NAT traffic within overlay network
{Table: "nat", Chain: "POSTROUTING", Rule: strings.Split(`-m set --match-set ovn60subnets src -m set --match-set ovn60subnets dst -j RETURN`, " ")},
// Prevent performing Masquerade on external traffic which arrives from a Node that owns the Pod/Subnet IP
{Table: "nat", Chain: "POSTROUTING", Rule: strings.Split(`-m set ! --match-set ovn40subnets src -m set --match-set ovn60local-pod-ip-nat dst -j RETURN`, " ")},
{Table: "nat", Chain: "POSTROUTING", Rule: strings.Split(`-m set ! --match-set ovn40subnets src -m set --match-set ovn60subnets-nat dst -j RETURN`, " ")},
Expand Down

0 comments on commit deef10a

Please sign in to comment.