Finding Public IP from Aerohive Command Line

How to get Public IP from Aerohive Command Line

There are many sites that are web based and you can simply ask someone to go to one of these websites and grab the public IP address such as ipchicken.com or whatismyip.com etc. Hover if you have a need to accomplish the same via command line there is hope. It is pretty easy to do it if you are running Cisco switches or Linux server/device. For Aerohive switches I had to play around with different options to see which will work if I want to find out the public IP of a site from Aerohive Switch or Command line. Running the following command did the trick.


exec http url ifconfig.co/ip
exec http url ifconfig.io/ip

See the response below that shows the Public IP address:


switch#exec http url ifconfig.co/ip

HTTP/1.1 200 OK

Date: Fri, 21 Sep 2018 13:23:28 GMT
Content-Type: text/plain; charset=utf-8
Content-Length: 12
Set-Cookie: __cfduid=adfasdfasdfasd; expires=Sat, 21-Sep-19 13:23:28 GMT; path=/; domain=.ifconfig.co; HttpOnly
Server: cloudflare
CF-RAY: adfasdfasdfas-IAD
X-Cache: MISS from domain.local
Via: 1.1 vegur, 1.1 domain.local (http_scan_byf/3.3.1)
Connection: keep-alive
#.#.#.# << === (This will be the public IP address)

You can host your own service and also don’t abuse the service if you are not hosting your own because you won’t get any results and/or might get blocked.

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress SEO