Open
Conversation
Signed-off-by: Aritra Basu <aritrbas@cisco.com>
282f4e3 to
d62e62d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
The network hook system provides two options for network configuration at each hook point:
ID_NET_NAME_*restorationAt each hook point, EITHER the native Go hook OR a user script runs, never both.
Specialized environments (like EKS and OpenShift) use custom scripts to fully override default behavior.
Execution Flow
Four Scenarios:
default_hook.shHook Points
There are 5 hook points:
BEFORE_IF_READID_NET_NAME_*+ MAC for each uplinkCALICOVPP_HOOK_BEFORE_IF_READBEFORE_VPP_RUNCALICOVPP_HOOK_BEFORE_VPP_RUNVPP_RUNNINGID_NET_NAME_*)CALICOVPP_HOOK_VPP_RUNNINGVPP_DONE_OKCALICOVPP_HOOK_VPP_DONE_OKVPP_ERROREDVPP_DONE_OKCALICOVPP_HOOK_VPP_ERROREDOptional User Hook Scripts
All default to empty (no scripts by default):
To add custom logic, set the env var:
Native Go Hooks
The
NetworkManagerHookGo module runs when no user script is configured and automatically handles:1. System Detection
2. DNS Management (NetworkManager)
dns=noneto/etc/NetworkManager/NetworkManager.confbefore VPP starts inBEFORE_VPP_RUNVPP_DONE_OK/VPP_ERRORED3. Network Service Restart
VPP_RUNNING) and after VPP stops (VPP_DONE_OK/VPP_ERRORED)systemctl restart systemd-udev-triggerto restore udevID_NET_NAME_*inVPP_RUNNINGor remove them inVPP_DONE_OK/VPP_ERRORED4. udev
ID_NET_NAME_*RestorationID_NET_NAME_ONBOARD/SLOT/PATH/MACand interface MAC/host/etc/udev/rules.d/99-vpp-restore-id_net_name.rulesbefore VPP creates taps (BEFORE_VPP_RUN)VPP_DONE_OK/VPP_ERRORED, reloads rules, and triggers udev change events for cleanup.systemd-networkdDHCPv6 IAID behavior stable across VPP interface transitionsControlling Hook Behavior
To use native Go hooks (default behavior):
CALICOVPP_ENABLE_NETWORK_MANAGER_HOOK=true (already set by default)To fallback to legacy
default_hook.sh:export CALICOVPP_ENABLE_NETWORK_MANAGER_HOOK=falseTo disable udev restoration sub-feature: