1

Is there some file in the Linux-Ubuntu filesystem that contains the internal IP of the machine running it? Ideally, is the output provided by the following command

hostname -I

saved somewhere in the filesystem?

(thanks to How do I find my internal ip address?)

1 Answers1

5

You can find a tree in /proc/net/fib_trie

Otherwise you can look it up with a tool such as ip addr

vidarlo
  • 22,691
  • Thanks for the answer! Is there another file that contains the public IP? – AndrewSpan Jul 06 '21 at 20:40
  • @AndrewSpan no. There's simply no way a host can know this. In complex configurations the answer may be multiple. At work internet egress depends on country, target and protocol for instance. – vidarlo Jul 06 '21 at 21:23