From c880780e48cc19b3ca8ec667ca49190d57a53db2 Mon Sep 17 00:00:00 2001 From: "Alex A. Naanou" Date: Sat, 27 Jan 2024 16:13:38 +0300 Subject: [PATCH] working on host... Signed-off-by: Alex A. Naanou --- .pct-helpers | 7 ++++--- config.global.example | 3 +++ host/bridges.tpl | 24 ++++++++++++++++++++++++ host/make.sh | 25 ++++++++++++++++++++++++- 4 files changed, 55 insertions(+), 4 deletions(-) create mode 100644 host/bridges.tpl diff --git a/.pct-helpers b/.pct-helpers index f99b346..d461420 100644 --- a/.pct-helpers +++ b/.pct-helpers @@ -473,10 +473,11 @@ PCT_TEMPLATE_VARS=( EMAIL DOMAIN CTHOSTNAME + HOST_ADMIN_IP GATE_HOSTNAME - NS_HOSTNAME GATE_LAN_IP GATE_ADMIN_IP + NS_HOSTNAME NS_LAN_IP NS_ADMIN_IP WAN_IP @@ -532,8 +533,8 @@ expandTemplate(){ # -# expandTemplate PATH [VAR ...] -# .. | expandTemplate [VAR ...] +# expandPCTTemplate PATH [VAR ...] +# .. | expandPCTTemplate [VAR ...] # expandPCTTemplate(){ local input= diff --git a/config.global.example b/config.global.example index 2b558bb..12d2572 100644 --- a/config.global.example +++ b/config.global.example @@ -85,6 +85,9 @@ DFL_PCT_EXTRA=SKIP # can be left as-is. # +# host +HOST_ADMIN_IP=10.0.0.245/24 + # Nameserver NS_HOSTNAME=ns NS_ID=100 diff --git a/host/bridges.tpl b/host/bridges.tpl new file mode 100644 index 0000000..aa04812 --- /dev/null +++ b/host/bridges.tpl @@ -0,0 +1,24 @@ + +auto vmbr0 +iface vmbr0 inet manual + bridge-ports none + bridge-stp off + bridge-fd 0 +#LAN + +auto vmbr1 +iface vmbr2 inet manual + bridge-ports ${WAN_PORT} + bridge-stp off + bridge-fd 0 +#WAN + +auto vmbr2 +iface vmbr3 inet static + address ${HOST_ADMIN_IP} + 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 cc09ac1..d99f76a 100644 --- a/host/make.sh +++ b/host/make.sh @@ -10,11 +10,22 @@ PATH=$PATH:$(dirname "$(pwd)") source ../.pct-helpers +#---------------------------------------------------------------------- + +need ifupdown2 + + #---------------------------------------------------------------------- readConfig +DFL_WAN_PORT=${DFL_WAN_PORT:-enp5s0} +DFL_ADMIN_PORT=${DFL_ADMIN_PORT:-enp2s0} + +# XXX move this to root config... +DFL_HOST_ADMIN_IP=${PROXMOX_ADMIN_IP:-10.0.0.254/24} + SOFTWARE=( make w3m links @@ -38,7 +49,19 @@ fi # Networking if xreadYes "# Create bridges?" BRIDGES ; then - echo + xread "WAN port: " WAN_PORT + xread "ADMIN port: " ADMIN_PORT + xread "Host ADMIN IP: " HOST_ADMIN_IP + xread "Gate ADMIN IP: " GATE_ADMIN_IP + + INTERFACES="${cat bridges.tpl \ + | expandPCTTemplate}" + + # XXX add $INTERFACES to /etc/network/interfaces either before the + # source command or at the end... + # XXX + + #@ ifupdown2 -a fi # Firewall