From 9d3a27157eda8ba2b00199987251773841859148 Mon Sep 17 00:00:00 2001 From: Denis 'GNUtoo' Carikli Date: Mon, 18 Sep 2023 21:08:23 +0200 Subject: [PATCH] Make the VM gateway IPv4 configurable The default gateway IP address is supposed to be used by Libre En Communs for the deployed VM. Signed-off-by: Denis 'GNUtoo' Carikli --- Makefile.am | 1 + configure.ac | 8 ++++++++ mumble-vm-system.scm.tmpl | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 1a10c7a..793a6fe 100644 --- a/Makefile.am +++ b/Makefile.am @@ -40,6 +40,7 @@ guix-commit.txt: Makefile s#LETSENCRYPT_EMAIL#$(LETSENCRYPT_EMAIL)#g ; \ s#VM_IPV4_ADDRESS#$(VM_IPV4_ADDRESS)#g ; \ s#VM_IPV6_ADDRESS#$(VM_IPV6_ADDRESS)#g ; \ + s#VM_IPV4_GATEWAY#$(VM_IPV4_GATEWAY)#g ; \ s#VM_SSH_PUB_KEY#$(VM_SSH_PUB_KEY)#g" $< > $@ %.sh: %.sh.tmpl guix-commit.txt Makefile diff --git a/configure.ac b/configure.ac index cd2d2da..bdee230 100644 --- a/configure.ac +++ b/configure.ac @@ -27,6 +27,7 @@ AC_SUBST([DOMAIN], []) AC_SUBST([LETSENCRYPT_EMAIL], []) AC_SUBST([VM_IPV4_ADDRESS], []) AC_SUBST([VM_IPV6_ADDRESS], []) +AC_SUBST([VM_IPV4_GATEWAY], []) AC_SUBST([VM_SSH_PUB_KEY], []) AC_ARG_WITH([domain], @@ -54,6 +55,12 @@ AC_ARG_WITH([vm-ipv6-address], [VM_IPV6_ADDRESS=$withval], [VM_IPV6_ADDRESS="2001:910:1021::117/64"]) +AC_ARG_WITH([vm-ipv4-gateway], + [AS_HELP_STRING([--with-vm-ipv4-gateway=VM_IPV4_GATEWAY], [Use custom VM + IPv4 gateway address. (default=192.168.0.1)])], + [VM_IPV4_GATEWAY=$withval], + [VM_IPV4_GATEWAY="192.168.0.1"]) + AC_ARG_WITH([vm-ssh-public-key], [AS_HELP_STRING([--with-ssh-vm-public-key=VM_SSH_PUB_KEY], [Use custom VM SSH public key for use with 'guix deploy'. (default=\ @@ -75,6 +82,7 @@ echo "- Domain: $DOMAIN" echo "- Let's Encrypt email: $LETSENCRYPT_EMAIL" echo "- VM IPv4 settings:" echo " address: $VM_IPV4_ADDRESS" +echo " gateway: $VM_IPV4_GATEWAY" echo "- VM IPv6 settings:" echo " address: $VM_IPV6_ADDRESS" echo "- VM SSH public key: $VM_SSH_PUB_KEY" diff --git a/mumble-vm-system.scm.tmpl b/mumble-vm-system.scm.tmpl index 4e51c1a..c2cb71e 100644 --- a/mumble-vm-system.scm.tmpl +++ b/mumble-vm-system.scm.tmpl @@ -193,7 +193,7 @@ https://DOMAIN/ (value "VM_IPV6_ADDRESS")))) (routes (list (network-route (destination "default") - (gateway "192.168.10.1")))) + (gateway "VM_IPV4_GATEWAY")))) (name-servers '("192.168.10.1"))))) ;; Nginx (service