Add configurable IPv6 for the VM

The default IP address is supposed to be used by Libre En Communs for
the deployed VM.

Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
This commit is contained in:
Denis 'GNUtoo' Carikli 2023-09-18 21:08:23 +02:00
parent eb7b6eb78a
commit 52e483228f
Signed by: GNUtoo
GPG Key ID: 5F5DFCC14177E263
3 changed files with 17 additions and 2 deletions

View File

@ -39,6 +39,7 @@ guix-commit.txt: Makefile
"s#DOMAIN#$(DOMAIN)#g ; \ "s#DOMAIN#$(DOMAIN)#g ; \
s#LETSENCRYPT_EMAIL#$(LETSENCRYPT_EMAIL)#g ; \ s#LETSENCRYPT_EMAIL#$(LETSENCRYPT_EMAIL)#g ; \
s#VM_IPV4_ADDRESS#$(VM_IPV4_ADDRESS)#g ; \ s#VM_IPV4_ADDRESS#$(VM_IPV4_ADDRESS)#g ; \
s#VM_IPV6_ADDRESS#$(VM_IPV6_ADDRESS)#g ; \
s#VM_SSH_PUB_KEY#$(VM_SSH_PUB_KEY)#g" $< > $@ s#VM_SSH_PUB_KEY#$(VM_SSH_PUB_KEY)#g" $< > $@
%.sh: %.sh.tmpl guix-commit.txt Makefile %.sh: %.sh.tmpl guix-commit.txt Makefile

View File

@ -26,6 +26,7 @@ AC_CHECK_PROG([SED], [sed], [sed])
AC_SUBST([DOMAIN], []) AC_SUBST([DOMAIN], [])
AC_SUBST([LETSENCRYPT_EMAIL], []) AC_SUBST([LETSENCRYPT_EMAIL], [])
AC_SUBST([VM_IPV4_ADDRESS], []) AC_SUBST([VM_IPV4_ADDRESS], [])
AC_SUBST([VM_IPV6_ADDRESS], [])
AC_SUBST([VM_SSH_PUB_KEY], []) AC_SUBST([VM_SSH_PUB_KEY], [])
AC_ARG_WITH([domain], AC_ARG_WITH([domain],
@ -47,9 +48,16 @@ AC_ARG_WITH([vm-ipv4-address],
[VM_IPV4_ADDRESS=$withval], [VM_IPV4_ADDRESS=$withval],
[VM_IPV4_ADDRESS="192.168.1.117/24"]) [VM_IPV4_ADDRESS="192.168.1.117/24"])
AC_ARG_WITH([vm-ipv6-address],
[AS_HELP_STRING([--with-vm-ipv6-address=VM_IPV6_ADDRESS], [Use custom VM
IPv6 address. (default=2001:910:1021::117/64)])],
[VM_IPV6_ADDRESS=$withval],
[VM_IPV6_ADDRESS="2001:910:1021::117/64"])
AC_ARG_WITH([vm-ssh-public-key], AC_ARG_WITH([vm-ssh-public-key],
[AS_HELP_STRING([--with-ssh-vm-public-key=VM_SSH_PUB_KEY], [Use custom VM [AS_HELP_STRING([--with-ssh-vm-public-key=VM_SSH_PUB_KEY], [Use custom VM
SSH public key for use with 'guix deploy'. (default=\ SSH public key for use with 'guix deploy'. (default=\
ssh-ed25519\ ssh-ed25519\
AAAAC3NzaC1lZDI1NTE5AAAAIEjLYbJ+47MTte960IbOUTRzOD012ewt1IZgOOc+NqDa)])], AAAAC3NzaC1lZDI1NTE5AAAAIEjLYbJ+47MTte960IbOUTRzOD012ewt1IZgOOc+NqDa)])],
[VM_SSH_PUB_KEY=$withval], [VM_SSH_PUB_KEY=$withval],
@ -65,5 +73,8 @@ echo "Configuration options:"
echo "======================" echo "======================"
echo "- Domain: $DOMAIN" echo "- Domain: $DOMAIN"
echo "- Let's Encrypt email: $LETSENCRYPT_EMAIL" echo "- Let's Encrypt email: $LETSENCRYPT_EMAIL"
echo "- VM IPv4 address: $VM_IPV4_ADDRESS" echo "- VM IPv4 settings:"
echo " address: $VM_IPV4_ADDRESS"
echo "- VM IPv6 settings:"
echo " address: $VM_IPV6_ADDRESS"
echo "- VM SSH public key: $VM_SSH_PUB_KEY" echo "- VM SSH public key: $VM_SSH_PUB_KEY"

View File

@ -187,7 +187,10 @@ https://DOMAIN/
(static-networking (static-networking
(addresses (list (network-address (addresses (list (network-address
(device "eth0") (device "eth0")
(value "VM_IPV4_ADDRESS")))) (value "VM_IPV4_ADDRESS"))
(network-address
(device "eth0")
(value "VM_IPV6_ADDRESS"))))
(routes (list (network-route (routes (list (network-route
(destination "default") (destination "default")
(gateway "192.168.10.1")))) (gateway "192.168.10.1"))))