<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>Networking on Mike&#39;s Blog</title>
        <link>https://mikerossiter.tech/tags/networking/</link>
        <description>Recent content in Networking on Mike&#39;s Blog</description>
        <generator>Hugo -- gohugo.io</generator>
        <language>en-gb</language>
        <lastBuildDate>Thu, 03 Apr 2025 13:04:14 +0100</lastBuildDate><atom:link href="https://mikerossiter.tech/tags/networking/index.xml" rel="self" type="application/rss+xml" /><item>
        <title>How to View Your Public IP Address in the Command Line</title>
        <link>https://mikerossiter.tech/posts/how-to-view-your-ip-address-in-the-command-line/</link>
        <pubDate>Tue, 04 Oct 2022 10:27:19 +0100</pubDate>
        
        <guid>https://mikerossiter.tech/posts/how-to-view-your-ip-address-in-the-command-line/</guid>
        <description>&lt;img src="https://mikerossiter.tech/world.png" alt="Featured image of post How to View Your Public IP Address in the Command Line" /&gt;&lt;h1 id=&#34;how-to-view-your-public-ip-address-in-the-command-line&#34;&gt;How to View Your Public IP Address in the Command Line
&lt;/h1&gt;&lt;p&gt;This is a short post but I discovered a really handy API in a great website: &lt;a class=&#34;link&#34; href=&#34;https://www.myip.com&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;MyIP.com&lt;/a&gt; No ads either. (&lt;em&gt;Noice!&lt;/em&gt;) It shows you your IP and some interesting stats too. I have utilised the API of the website to make this handy command because it isn&amp;rsquo;t often that straightforward and running &lt;code&gt;ip a&lt;/code&gt; or &lt;code&gt;ifconfig&lt;/code&gt; only shows you the addresses for what is happening locally. So the command I&amp;rsquo;m using is:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-fallback&#34; data-lang=&#34;fallback&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;curl -s https://api.myip.com | jq .ip | tr -d \&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Taking this apart, we can run the curl command and return some useful values in json format. Hence the inclusion of the &lt;code&gt;jq&lt;/code&gt; parse tool which pulls out only the IP address. Finally the &lt;code&gt;tr&lt;/code&gt; tool simply trims off the surrounding quotes which is nicer to look at and might make this command more useful in a script or something. I don&amp;rsquo;t know. Or whatever you want to use it for.&lt;/p&gt;
&lt;p&gt;So there you go! If this helped you too then you can help me stay awake by &lt;a class=&#34;link&#34; href=&#34;https://www.buymeacoffee.com/mikerossiter&#34;  target=&#34;_blank&#34; rel=&#34;noopener&#34;
    &gt;buying me a coffee&lt;/a&gt;. Thanks!&lt;/p&gt;
</description>
        </item>
        
    </channel>
</rss>
