From 8b8822d94430df171247e4f95949e1e21057d917 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 19 Oct 2024 15:09:34 +0300 Subject: [PATCH] tweaks... Signed-off-by: Alex A. Naanou --- config.global.example | 17 +++++++++++++---- gate-traefik/make.sh | 8 +++++--- host/bootstrap-bridges.tpl | 10 ++++++++-- host/bridges.tpl | 5 ++--- host/make.sh | 11 +++++++---- 5 files changed, 35 insertions(+), 16 deletions(-) diff --git a/config.global.example b/config.global.example index a522864..2c816e1 100644 --- a/config.global.example +++ b/config.global.example @@ -18,6 +18,15 @@ # #------------------------------------------------------------------------ +# Bootsrap configuration... +# +# Usually this is the default bridge created in Proxmox, so there is no +# need to touch this. +BOOTSTRAP_BRIDGE=0 +# XXX +#BOOTSTRAP_PORT=none + + # CT interface bridge configuration. # # These are set to the bridge number (the number in 'vmbr#') used for @@ -34,10 +43,10 @@ # ADMIN_BRIDGE=3 # LAN_BRIDGE=10 # -BOOTSTRAP_BRIDGE=0 -ADMIN_BRIDGE=00 -WAN_BRIDGE=03 -LAN_BRIDGE=10 +# XXX revise numbering... +ADMIN_BRIDGE=_admin +WAN_BRIDGE=_wan +LAN_BRIDGE=_lan # NOTE: it is simpler to statically assign these than to configure dhcp diff --git a/gate-traefik/make.sh b/gate-traefik/make.sh index 4e9a3e4..476fb64 100755 --- a/gate-traefik/make.sh +++ b/gate-traefik/make.sh @@ -42,14 +42,15 @@ REBOOT=${REBOOT:=1} # Bootstrap cleanup... if ! [ -z $BOOTSTRAP_CLEAN ] ; then - ID=${GATE_ID:=${DFL_ID}} + #ID=${ID:-${DFL_ID}} xread "ID: " ID + xread "Bootstrap bridge:" BOOSTRAP_BRIDGE readBridgeVars echo "# Reverting gate's WAN bridge to: vmbr${WAN_BRIDGE}..." @ sed -i \ - -e 's/^\(net0.*vmbr\)'${ADMIN_BRIDGE}'/\1'${WAN_BRIDGE}'/' \ + -e 's/^\(net0.*vmbr\)'${BOOSTRAP_BRIDGE}'/\1'${WAN_BRIDGE}'/' \ /etc/pve/lxc/${ID}.conf exit fi @@ -59,8 +60,9 @@ fi # Bootstrap... if ! [ -z $BOOTSTRAP ] ; then + xread "Bootstrap bridge:" BOOSTRAP_BRIDGE # this will allow the bootstrapped CTs to access the network... - WAN_BRIDGE=${ADMIN_BRIDGE} + WAN_BRIDGE=${BOOSTRAP_BRIDGE} fi diff --git a/host/bootstrap-bridges.tpl b/host/bootstrap-bridges.tpl index d2a3462..d0e1f2a 100644 --- a/host/bootstrap-bridges.tpl +++ b/host/bootstrap-bridges.tpl @@ -1,6 +1,4 @@ -# NOTE: this assumes the ADMIN bridge to exist (proxmox default) and to be vmbr0... - auto vmbr${LAN_BRIDGE} iface vmbr${LAN_BRIDGE} inet manual bridge-ports none @@ -15,3 +13,11 @@ iface vmbr${WAN_BRIDGE} inet manual bridge-fd 0 #WAN +auto vmbr${ADMIN_BRIDGE} +iface vmbr${ADMIN_BRIDGE} inet static + address ${HOST_ADMIN_IP} + bridge-ports ${BOOTSTRAP_ADMIN_BRIDGE} + bridge-stp off + bridge-fd 0 +#ADMIN + diff --git a/host/bridges.tpl b/host/bridges.tpl index 9170507..feb4f16 100644 --- a/host/bridges.tpl +++ b/host/bridges.tpl @@ -16,9 +16,8 @@ iface vmbr${WAN_BRIDGE} inet manual auto vmbr${ADMIN_BRIDGE} iface vmbr${ADMIN_BRIDGE} inet static address ${HOST_ADMIN_IP} - #gateway ${GATE_ADMIN_IPn} - #bridge-ports ${ADMIN_PORT} - bridge-ports none + gateway ${GATE_ADMIN_IPn} + bridge-ports ${ADMIN_PORT} bridge-stp off bridge-fd 0 #ADMIN diff --git a/host/make.sh b/host/make.sh index 0e6e333..80008fe 100755 --- a/host/make.sh +++ b/host/make.sh @@ -48,6 +48,7 @@ BRIDGES_TPL=bridges.tpl if ! [ -z $BOOTSTRAP_CLEAN ] ; then # XXX switch admin interface IP and Gateway to admin net... + # # update ADMIN_BRIDGE: # - set gateway # - set bridge port to admin port @@ -59,10 +60,12 @@ fi # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Bootstrap... +# XXX if ! [ -z $BOOTSTRAP ] ; then - # XXX - #BRIDGES_TPL=bootstrap-bridges.tpl - true + DFL_BOOTSTRAP_ADMIN_PORT=${DFL_BOOTSTRAP_ADMIN_PORT:-none} + xread "Bootstrap port: " BOOTSTRAP_ADMIN_PORT + + BRIDGES_TPL=bootstrap-bridges.tpl fi @@ -122,7 +125,7 @@ if xreadYes "# Create bridges?" BRIDGES ; then cat "$BRIDGES_TPL" \ | expandPCTTemplate \ LAN_BRIDGE WAN_BRIDGE ADMIN_BRIDGE \ - WAN_PORT ADMIN_PORT \ + WAN_PORT ADMIN_PORT BOOTSTRAP_ADMIN_PORT \ HOST_ADMIN_IP GATE_ADMIN_IP)" if [ -z "$DRY_RUN" ] ; then