From 9770e7bec287fa130a9f78a231214a24c13abc14 Mon Sep 17 00:00:00 2001 From: tiyn Date: Thu, 16 Feb 2023 03:16:24 +0100 Subject: [PATCH] ip: get outside ip now correct --- wiki/linux/ip.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/wiki/linux/ip.md b/wiki/linux/ip.md index 266f1a1..b0a0e7b 100644 --- a/wiki/linux/ip.md +++ b/wiki/linux/ip.md @@ -32,7 +32,10 @@ ip link set wlan0 down For VPN and other applications using a tunnel it can be useful to check the outside IP of your system. -Together with `awk` only the outside IP address can be displayed. -This is done with the command `ip route get 1.2.3.4 | awk '{print $7}'`. -Alternatively it can be done without `awk` by simply running the command -`ip route get 1.2.3.4` and checking for the seventh column. +The following command uses the `dig` command. +It is either bundled in the `dig` package - like in +[Arch Linux](/wiki/linux/arch-linux/arch-linux.md) - or in the `dnsutils` +package - like in Ubuntu - or even another package depending on the distribution +used. +After installation the following command can be used to get the outside IP +address of your system `dig +short txt ch whoami.cloudflare @1.0.0.1`.