NetVM: 1:1 profile:node mapping — hashed iface names, netvm-enter + netvm-chrome launcher
This commit is contained in:
Executable
+13
@@ -0,0 +1,13 @@
|
||||
# netvm-names.sh — source this. Sets NETNS WG VETH VPEER SUB GW PEER_IP from NODE.
|
||||
# 1:1 mapping: profile name = node name. Interface names must fit 15 chars,
|
||||
# so wg/veth use a deterministic hash tag; the netns keeps the full name.
|
||||
netvm_names() {
|
||||
NODE="$1"
|
||||
NETNS="warp-${NODE}"
|
||||
_tag=$(echo -n "$NODE" | sha256sum | cut -c1-8)
|
||||
WG="wb-${_tag}"
|
||||
VETH="ve-${_tag}"
|
||||
VPEER="vp-${_tag}"
|
||||
_idx=$(( 0x${_tag:0:3} % 200 + 10 ))
|
||||
GW="10.201.${_idx}.1"; PEER_IP="10.201.${_idx}.2"; SUB="10.201.${_idx}.0/30"
|
||||
}
|
||||
Reference in New Issue
Block a user