mirror of
https://github.com/tiyn/wiki.git
synced 2025-04-19 06:07:44 +02:00
Compare commits
No commits in common. "186cb9222d4c94ed2aa06c34b1cb2aa71936a778" and "29633b165a99e9e40afc65bcf353b028451cacf6" have entirely different histories.
186cb9222d
...
29633b165a
@ -32,22 +32,7 @@ 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.
|
||||
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.
|
||||
|
||||
```sh
|
||||
dig +short txt ch whoami.cloudflare @1.0.0.1
|
||||
```
|
||||
|
||||
There is an alternative to this using `wget`.
|
||||
It uses a call to DuckDuckGo and requests the outside IP from there.
|
||||
The mentioned command is the following.
|
||||
|
||||
```sh
|
||||
wget -qqO- 'https://duckduckgo.com/?q=what+is+my+ip' | grep -Pow 'Your IP address is \K[0-9.]+'
|
||||
```
|
||||
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.
|
||||
|
Loading…
x
Reference in New Issue
Block a user