Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
2
rated 0 times [  2] [ 0]  / answers: 1 / hits: 3051  / 2 Years ago, thu, july 7, 2022, 6:46:05

I am connected to Internet through an ADSL modem, my ISP gives me an IP address, does Ubuntu log this IP address somewhere?



How can I configure Ubuntu to log the IP address?


More From » networking

 Answers
1

Or you can do it yourself, using curl to access a number of online services that respond with your public IP address.



Some of the services:





Example:



curl icanhazip.com will output to terminal



curl icanhazip.com > my_public_ip.txt will create or overide a txt file named my_public_ip.txt with the IP.



curl icanhazip.com >> my_public_ip.txt will append the public IP every time the command runs.



You could create a small script to run the check and even add it as cron job to run say every time the machine reboots or at some intervals.



The simplest version could be:



#!/usr/bin/env bash

curl icanhazip.com >> my_public_ip.txt

[#29792] Friday, July 8, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
socelebrate

Total Points: 274
Total Questions: 123
Total Answers: 124

Location: Saint Helena
Member since Mon, Jan 16, 2023
1 Year ago
;