I have researched and found dozens of ways to determine the public IP on a standard Rasbian or UbuntuMate Distro. Because I am working in UbuntuCore I do not have access to any thing that I cannot install through the snap package installer. (background) I am creating a networked surveillance system for a class project but have some limitations due to the high security of the school/test network. I've narrowed my search to a package/tool to perform http get request though I'm not sure I'm looking in the correct direction
how can i find the public IP address (external) using UbuntuCore? not curl/telnet/wget/dig maybe netcat?
Welcome to Raspberry Pi SE. Feel free to take the tour at raspberrypi.stackexchange.com/Tour that will help you get the most from this site. Have you tried just using your web browser? Many sites will feed it back to you like GRC's Shields-Up and bearsmyip.com– SDsolarApr 20, 2018 at 2:21
After a very specific search (netcat what is my ip) I found this post. My solution was the second answer:
echo 'GET /' | nc icanhazip.com 80 worked and gave me exactly what I was looking for... Hope someone else finds this useful!
2The command does not work for me on
Raspbian 2018-03-13. I get the error message
usage: nc [...].– IngoApr 20, 2018 at 10:27
Hey sorry about that. Its not a version issue I forgot to include the port number in the original post is all. Thanks this was helpful Jun 13, 2018 at 17:11