File tree Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Expand file tree Collapse file tree 2 files changed +31
-2
lines changed Original file line number Diff line number Diff line change @@ -330,8 +330,8 @@ user nobody
330
330
group nogroup
331
331
EOF
332
332
333
- # This was in the heredoc, we use the new function instead
334
- process_push_config " block-outside-dns"
333
+ # only block outside dns when we take the default route
334
+ [ " $OVPN_DEFROUTE " == " 1 " ] && process_push_config " block-outside-dns"
335
335
336
336
[ -n " $OVPN_TLS_CIPHER " ] && echo " tls-cipher $OVPN_TLS_CIPHER " >> " $conf "
337
337
[ -n " $OVPN_CIPHER " ] && echo " cipher $OVPN_CIPHER " >> " $conf "
Original file line number Diff line number Diff line change @@ -199,3 +199,32 @@ then
199
199
else
200
200
abort " ==> Config match not found: $CONFIG_REQUIRED_TCP_REMOTE_2 != $CONFIG_MATCH_TCP_REMOTE_2 "
201
201
fi
202
+
203
+ # Test non-defroute config
204
+
205
+ SERV_IP=$( ip -4 -o addr show scope global | awk ' {print $4}' | sed -e ' s:/.*::' | head -n1)
206
+ ovpn_genconfig -d -u udp://$SERV_IP -r " 172.33.33.0/24" -r " 172.34.34.0/24"
207
+ # nopass is insecure
208
+ EASYRSA_BATCH=1 EASYRSA_REQ_CN=" Travis-CI Test CA" ovpn_initpki nopass
209
+ easyrsa build-client-full client-fallback nopass
210
+ ovpn_getclient client-fallback | tee /etc/openvpn/config-fallback.ovpn
211
+
212
+ CONFIG_REQUIRED_BLOCK_OUTSIDE_DNS=" "
213
+ CONFIG_MATCH_BLOCK_OUTSIDE_DNS=$( busybox grep ' push block-outside-dns' /etc/openvpn/openvpn.conf)
214
+
215
+ if [[ $CONFIG_MATCH_BLOCK_OUTSIDE_DNS =~ $CONFIG_REQUIRED_BLOCK_OUTSIDE_DNS ]]
216
+ then
217
+ echo " ==> Config match found: $CONFIG_REQUIRED_BLOCK_OUTSIDE_DNS == $CONFIG_MATCH_BLOCK_OUTSIDE_DNS "
218
+ else
219
+ abort " ==> Config match not found: $CONFIG_REQUIRED_BLOCK_OUTSIDE_DNS != $CONFIG_MATCH_BLOCK_OUTSIDE_DNS "
220
+ fi
221
+
222
+ CONFIG_REQUIRED_REDIRECT_GATEWAY=" "
223
+ CONFIG_MATCH_REDIRECT_GATEWAY=$( busybox grep " redirect-gateway def1" /etc/openvpn/config-fallback.ovpn)
224
+
225
+ if [[ $CONFIG_MATCH_REDIRECT_GATEWAY =~ $CONFIG_REQUIRED_REDIRECT_GATEWAY ]]
226
+ then
227
+ echo " ==> Config match found: $CONFIG_REQUIRED_REDIRECT_GATEWAY == $CONFIG_MATCH_REDIRECT_GATEWAY "
228
+ else
229
+ abort " ==> Config match not found: $CONFIG_REQUIRED_REDIRECT_GATEWAY != $CONFIG_MATCH_REDIRECT_GATEWAY "
230
+ fi
You can’t perform that action at this time.
0 commit comments