Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[v1.12-backport] Introduce fromEgressProxyRule #31930

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions bpf/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ function setup_proxy_rules()
# Any packet from an ingress proxy uses a separate routing table that routes
# the packet back to the cilium host device.
from_ingress_rulespec="fwmark 0xA00/0xF00 pref 10 lookup $PROXY_RT_TABLE"
from_egress_rulespec="fwmark 0xB00/0xF00 pref 10 lookup $PROXY_RT_TABLE"

# Any packet to an ingress or egress proxy uses a separate routing table
# that routes the packet to the loopback device regardless of the destination
Expand All @@ -134,6 +135,9 @@ function setup_proxy_rules()
ip -4 rule add $from_ingress_rulespec
fi
fi
if [ ! -z "$(ip -4 rule list $from_egress_rulespec)" ]; then
ip -4 rule delete $from_egress_rulespec 2> /dev/null || true
fi
fi

# Traffic to the host proxy is local
Expand Down Expand Up @@ -165,6 +169,9 @@ function setup_proxy_rules()
ip -6 rule add $from_ingress_rulespec
fi
fi
if [ ! -z "$(ip -6 rule list $from_egress_rulespec)" ]; then
ip -6 rule delete $from_egress_rulespec 2> /dev/null || true
fi
fi

IP6_LLADDR=$(ip -6 addr show dev $HOST_DEV2 | grep inet6 | head -1 | awk '{print $2}' | awk -F'/' '{print $1}')
Expand Down
Loading