mirror of
https://github.com/pi-hole/pi-hole.git
synced 2024-11-15 10:43:55 +00:00
Get the IP address that is the source for the default route out. Fixes interfaces with multiple IP's assigned getting the wrong IPv4 chosen.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
ffd31d8330
commit
c2b8bed3a8
1 changed files with 1 additions and 1 deletions
|
@ -182,7 +182,7 @@ getGitFiles() {
|
|||
find_IPv4_information() {
|
||||
# Find IP used to route to outside world
|
||||
IPv4dev=$(ip route get 8.8.8.8 | awk '{for(i=1;i<=NF;i++)if($i~/dev/)print $(i+1)}')
|
||||
IPV4_ADDRESS=$(ip -o -f inet addr show dev "$IPv4dev" | awk '{print $4}' | awk 'END {print}')
|
||||
IPV4_ADDRESS=$(ip route get 8.8.8.8| awk '{print $7}')
|
||||
IPv4gw=$(ip route get 8.8.8.8 | awk '{print $3}')
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue