From 021a850a5eb837136fe674168be1cb1fb58d0d68 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 25 Sep 2017 10:52:17 +0100 Subject: [PATCH] Change dns used for external IP address detection --- src/freedombone-utils-network | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/freedombone-utils-network b/src/freedombone-utils-network index 2befcc1a..7ae83975 100755 --- a/src/freedombone-utils-network +++ b/src/freedombone-utils-network @@ -31,6 +31,12 @@ # If the system is on an IPv6 network IPV6_NETWORK='2001:470:26:307' +# Destinations used to get the external IP address of this system +# Google ipv6 DNS is 2001:4860:4860::8888 +IPV4_ADDRESS_TEST_DESTINATION='85.214.73.63' +IPV6_ADDRESS_TEST_DESTINATION='2620:0:ccc::2' + + # The static IP address of the system within the local network # By default the IP address is dynamic within your LAN LOCAL_NETWORK_STATIC_IP_ADDRESS= @@ -65,12 +71,12 @@ function install_static_network { } function get_ipv4_address { - IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}') + IPv4dev=$(ip route get $IPV4_ADDRESS_TEST_DESTINATION | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}') echo $(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}' | awk -F '/' '{print $1}') } function get_ipv6_address { - echo $(ip -6 route get 2001:4860:4860::8888 | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }') + echo $(ip -6 route get $IPV6_ADDRESS_TEST_DESTINATION | awk -F " " '{ for(i=1;i<=NF;i++) if ($i == "src") print $(i+1) }') } # NOTE: deliberately no exit 0