From 2caf08d5dd9d82087c16390a34e8ab169be75369 Mon Sep 17 00:00:00 2001 From: "root@culturestrings" Date: Wed, 1 Jul 2020 08:57:05 +0000 Subject: networking: introduced $vpn_net4, $vpn_ipv5, $host_ipv4, $host_ipv6. --- public/fs/etc/openvpn/hostvpn-conf.sh | 4 ++++ public/fs/etc/openvpn/hostvpn.conf.in | 8 ++++---- public/fs/etc/pagure/pagure.cfg.in | 2 +- public/fs/etc/sysconfig/network/ifcfg-eth0 | 6 ------ public/fs/etc/sysconfig/network/ifcfg-eth0-conf.sh | 12 ++++++++++++ public/fs/etc/sysconfig/network/ifcfg-eth0.in | 6 ++++++ 6 files changed, 27 insertions(+), 11 deletions(-) delete mode 100644 public/fs/etc/sysconfig/network/ifcfg-eth0 create mode 100755 public/fs/etc/sysconfig/network/ifcfg-eth0-conf.sh create mode 100644 public/fs/etc/sysconfig/network/ifcfg-eth0.in (limited to 'public/fs/etc') diff --git a/public/fs/etc/openvpn/hostvpn-conf.sh b/public/fs/etc/openvpn/hostvpn-conf.sh index cdfdb1c..a438a54 100755 --- a/public/fs/etc/openvpn/hostvpn-conf.sh +++ b/public/fs/etc/openvpn/hostvpn-conf.sh @@ -12,4 +12,8 @@ source /root/config/private/config/hostinfo/${sitezone} sed -e 's/@vpn_port@/'${vpn_port}'/g' \ -e 's/@hostname@/'${hostname}'/g' \ + -e 's/@vpn_net4@/'${vpn_net4}'/g' \ + -e 's/@vpn_ipv4@/'${vpn_ipv4}'/g' \ + -e 's/@host_ipv4@/'${host_ipv4}'/g' \ + -e 's/@host_ipv6@/'${host_ipv6}'/g' \ "${cfg_srcdir}/hostvpn.conf.in" diff --git a/public/fs/etc/openvpn/hostvpn.conf.in b/public/fs/etc/openvpn/hostvpn.conf.in index a285e12..bf58a4f 100644 --- a/public/fs/etc/openvpn/hostvpn.conf.in +++ b/public/fs/etc/openvpn/hostvpn.conf.in @@ -16,16 +16,16 @@ dh /etc/easy-rsa/pki/dh.pem status /var/log/openvpn/openvpn-status.log log-append /var/log/openvpn/openvpn.log -server 10.8.0.0 255.255.255.0 -server-ipv6 2a01:4f9:2b:20f0:8000::/65 +server @vpn_net4@ 255.255.255.0 +server-ipv6 @host_ipv6@:8000::/65 push "route-ipv6 2000::/3" -push "route-ipv6 2a01:4f9:2b:20f0::/64" +push "route-ipv6 host_ipv6::/64" push "block-outside-dns" push "redirect-gateway def1" push "route 192.168.0.0 255.255.255.0" -push "dhcp-option DNS 10.8.0.1" +push "dhcp-option DNS @vpn_ipv4@" duplicate-cn client-to-client diff --git a/public/fs/etc/pagure/pagure.cfg.in b/public/fs/etc/pagure/pagure.cfg.in index bfc1122..a80c469 100644 --- a/public/fs/etc/pagure/pagure.cfg.in +++ b/public/fs/etc/pagure/pagure.cfg.in @@ -113,7 +113,7 @@ GIT_URL_GIT = 'https://dev.@sitezone@/' ### gunicorn -IP_ALLOWED_INTERNAL = ['10.8.0.1', '127.0.0.1', 'localhost', '::1', ''] +IP_ALLOWED_INTERNAL = ['@vpn_ipv4@', '127.0.0.1', 'localhost', '::1', ''] ### event source options diff --git a/public/fs/etc/sysconfig/network/ifcfg-eth0 b/public/fs/etc/sysconfig/network/ifcfg-eth0 deleted file mode 100644 index c2fc421..0000000 --- a/public/fs/etc/sysconfig/network/ifcfg-eth0 +++ /dev/null @@ -1,6 +0,0 @@ -BOOTPROTO='dhcp' -STARTMODE='auto' - -IPADDR_0='2a01:4f9:2b:20f0::2/65' -LABEL_0='ipv6' -NETMASK_0='' diff --git a/public/fs/etc/sysconfig/network/ifcfg-eth0-conf.sh b/public/fs/etc/sysconfig/network/ifcfg-eth0-conf.sh new file mode 100755 index 0000000..d116219 --- /dev/null +++ b/public/fs/etc/sysconfig/network/ifcfg-eth0-conf.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +set -eu + +cfg_script="$0" +cfg_srcdir=$(cd -- "${cfg_script%/*}/" ; pwd -P) + +source /root/config/private/config/server.ports + +sed -e 's/@host_ipv4@/'${host_ipv4}'/g' \ + -e 's/@host_ipv6@/'${host_ipv6}'/g' \ + "${cfg_srcdir}/ifcfg-eth0.in" diff --git a/public/fs/etc/sysconfig/network/ifcfg-eth0.in b/public/fs/etc/sysconfig/network/ifcfg-eth0.in new file mode 100644 index 0000000..8060f46 --- /dev/null +++ b/public/fs/etc/sysconfig/network/ifcfg-eth0.in @@ -0,0 +1,6 @@ +BOOTPROTO='dhcp' +STARTMODE='auto' + +IPADDR_0='@host_ipv6@::2/65' +LABEL_0='ipv6' +NETMASK_0='' -- cgit v1.2.3