tweaks...

Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
Alex A. Naanou 2024-10-19 15:09:34 +03:00
parent 1f01f637bc
commit 8b8822d944
5 changed files with 35 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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...
if ! [ -z $BOOTSTRAP ] ; then
# XXX
#BRIDGES_TPL=bootstrap-bridges.tpl
true
if ! [ -z $BOOTSTRAP ] ; then
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