From 97a50c66efe712bf998afa510514529af2a1a758 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Thu, 21 Sep 2017 10:49:45 -0500 Subject: [PATCH 1/4] Commented out a number of excess options that were set implicitly by using the 'server' option. --- server_config.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/server_config.txt b/server_config.txt index 70625e7..9fa8e0c 100644 --- a/server_config.txt +++ b/server_config.txt @@ -8,11 +8,11 @@ dh /etc/openvpn/easy-rsa/pki/dh1024.pem topology subnet server 10.8.0.0 255.255.255.0 # server and remote endpoints -ifconfig 10.8.0.1 10.8.0.2 +#ifconfig 10.8.0.1 10.8.0.2 # Add route to Client routing table for the OpenVPN Server -push "route 10.8.0.1 255.255.255.255" +#push "route 10.8.0.1 255.255.255.255" # Add route to Client routing table for the OPenVPN Subnet -push "route 10.8.0.0 255.255.255.0" +#push "route 10.8.0.0 255.255.255.0" # your local subnet push "route LOCALNET LOCALMASK" # Set your primary domain name server address for clients From 4e77245a97010bd93c44b57b3327a0b0c6fd16e4 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Fri, 22 Sep 2017 16:03:38 -0500 Subject: [PATCH 2/4] Commented out code related to adding a route to the remote subnet (e.g. 192.168.0.0). --- auto_install/install.sh | 20 ++++++++++---------- server_config.txt | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 33ca2a4..5f7c5b2 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -367,15 +367,15 @@ setStaticIPv4() { fi } -setNetwork() { +#setNetwork() { # Sets the Network IP and Mask correctly - export PATH=${PATH}:/sbin:/usr/sbin - LOCALMASK=$(ifconfig "${pivpnInterface}" | awk '/Mask:/{ print $4;} ' | cut -c6-) - LOCALIP=$(ifconfig "${pivpnInterface}" | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*') - IFS=. read -r i1 i2 i3 i4 <<< "$LOCALIP" - IFS=. read -r m1 m2 m3 m4 <<< "$LOCALMASK" - LOCALNET=$(printf "%d.%d.%d.%d\n" "$((i1 & m1))" "$((i2 & m2))" "$((i3 & m3))" "$((i4 & m4))") -} + #export PATH=${PATH}:/sbin:/usr/sbin + #LOCALMASK=$(ifconfig "${pivpnInterface}" | awk '/Mask:/{ print $4;} ' | cut -c6-) + #LOCALIP=$(ifconfig "${pivpnInterface}" | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*') + #IFS=. read -r i1 i2 i3 i4 <<< "$LOCALIP" + #IFS=. read -r m1 m2 m3 m4 <<< "$LOCALMASK" + #LOCALNET=$(printf "%d.%d.%d.%d\n" "$((i1 & m1))" "$((i2 & m2))" "$((i3 & m3))" "$((i4 & m4))") +#} function valid_ip() { @@ -887,8 +887,8 @@ EOF # Write config file for server using the template .txt file $SUDO cp /etc/.pivpn/server_config.txt /etc/openvpn/server.conf - $SUDO sed -i "s/LOCALNET/${LOCALNET}/g" /etc/openvpn/server.conf - $SUDO sed -i "s/LOCALMASK/${LOCALMASK}/g" /etc/openvpn/server.conf + #$SUDO sed -i "s/LOCALNET/${LOCALNET}/g" /etc/openvpn/server.conf + #$SUDO sed -i "s/LOCALMASK/${LOCALMASK}/g" /etc/openvpn/server.conf # Set the user encryption key size $SUDO sed -i "s/\(dh \/etc\/openvpn\/easy-rsa\/pki\/dh\).*/\1${ENCRYPT}.pem/" /etc/openvpn/server.conf diff --git a/server_config.txt b/server_config.txt index 9fa8e0c..2498464 100644 --- a/server_config.txt +++ b/server_config.txt @@ -14,7 +14,7 @@ server 10.8.0.0 255.255.255.0 # Add route to Client routing table for the OPenVPN Subnet #push "route 10.8.0.0 255.255.255.0" # your local subnet -push "route LOCALNET LOCALMASK" +#push "route LOCALNET LOCALMASK" # Set your primary domain name server address for clients push "dhcp-option DNS 8.8.8.8" push "dhcp-option DNS 8.8.4.4" From 14b13d3a4156b89be026adcdff775bd57a0998f4 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Sat, 23 Sep 2017 19:17:35 -0500 Subject: [PATCH 3/4] Removed the previously commented-out code. --- auto_install/install.sh | 13 ------------- server_config.txt | 8 -------- 2 files changed, 21 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index 5f7c5b2..be833ce 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -367,16 +367,6 @@ setStaticIPv4() { fi } -#setNetwork() { - # Sets the Network IP and Mask correctly - #export PATH=${PATH}:/sbin:/usr/sbin - #LOCALMASK=$(ifconfig "${pivpnInterface}" | awk '/Mask:/{ print $4;} ' | cut -c6-) - #LOCALIP=$(ifconfig "${pivpnInterface}" | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*') - #IFS=. read -r i1 i2 i3 i4 <<< "$LOCALIP" - #IFS=. read -r m1 m2 m3 m4 <<< "$LOCALMASK" - #LOCALNET=$(printf "%d.%d.%d.%d\n" "$((i1 & m1))" "$((i2 & m2))" "$((i3 & m3))" "$((i4 & m4))") -#} - function valid_ip() { local ip=$1 @@ -887,9 +877,6 @@ EOF # Write config file for server using the template .txt file $SUDO cp /etc/.pivpn/server_config.txt /etc/openvpn/server.conf - #$SUDO sed -i "s/LOCALNET/${LOCALNET}/g" /etc/openvpn/server.conf - #$SUDO sed -i "s/LOCALMASK/${LOCALMASK}/g" /etc/openvpn/server.conf - # Set the user encryption key size $SUDO sed -i "s/\(dh \/etc\/openvpn\/easy-rsa\/pki\/dh\).*/\1${ENCRYPT}.pem/" /etc/openvpn/server.conf diff --git a/server_config.txt b/server_config.txt index 2498464..f3d208b 100644 --- a/server_config.txt +++ b/server_config.txt @@ -7,14 +7,6 @@ key /etc/openvpn/easy-rsa/pki/private/server.key dh /etc/openvpn/easy-rsa/pki/dh1024.pem topology subnet server 10.8.0.0 255.255.255.0 -# server and remote endpoints -#ifconfig 10.8.0.1 10.8.0.2 -# Add route to Client routing table for the OpenVPN Server -#push "route 10.8.0.1 255.255.255.255" -# Add route to Client routing table for the OPenVPN Subnet -#push "route 10.8.0.0 255.255.255.0" -# your local subnet -#push "route LOCALNET LOCALMASK" # Set your primary domain name server address for clients push "dhcp-option DNS 8.8.8.8" push "dhcp-option DNS 8.8.4.4" From 9f46f1ef91045a6b7cfb92721843dc3d36b32fa2 Mon Sep 17 00:00:00 2001 From: Jelle Dekker Date: Wed, 11 Oct 2017 22:55:58 -0500 Subject: [PATCH 4/4] Removed call to deleted method. --- auto_install/install.sh | 3 --- 1 file changed, 3 deletions(-) diff --git a/auto_install/install.sh b/auto_install/install.sh index be833ce..379ea47 100755 --- a/auto_install/install.sh +++ b/auto_install/install.sh @@ -1255,9 +1255,6 @@ main() { setStaticIPv4 fi - # Set the Network IP and Mask correctly - setNetwork - # Choose the user for the ovpns chooseUser