<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>netcat | no dogma blog</title><link>https://nodogmablog.bryanhogan.net/tag/netcat/</link><atom:link href="https://nodogmablog.bryanhogan.net/tag/netcat/index.xml" rel="self" type="application/rss+xml"/><description>netcat</description><generator>Wowchemy (https://wowchemy.com)</generator><language>en-us</language><lastBuildDate>Thu, 02 Jul 2026 00:00:00 +0000</lastBuildDate><image><url>https://nodogmablog.bryanhogan.net/media/icon_hu9c23d68d4e9f1f9acfa8237e5c2ea674_3344_512x512_fill_lanczos_center_3.png</url><title>netcat</title><link>https://nodogmablog.bryanhogan.net/tag/netcat/</link></image><item><title>Using netcat for a Simple Connectivity Test</title><link>https://nodogmablog.bryanhogan.net/2026/07/using-netcat-for-a-simple-connectivity-test/</link><pubDate>Thu, 02 Jul 2026 00:00:00 +0000</pubDate><guid>https://nodogmablog.bryanhogan.net/2026/07/using-netcat-for-a-simple-connectivity-test/</guid><description>&lt;p>This is mainly for myself when I forget how to this.&lt;/p>
&lt;p>I use netcat, &lt;code>nc&lt;/code>, to test connectivity between two hosts from time to time, often with containers in Docker compose, but I don&amp;rsquo;t do it often enough to remember the syntax.&lt;/p>
&lt;p>So here it is.&lt;/p>
&lt;p>To start the listener, run this -&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-cfg" data-lang="cfg">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">nc -l -p 9999&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;p>And to connect to the listener, run this -&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="background-color:#fff;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-cfg" data-lang="cfg">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#000">nc &amp;lt;listener-host&amp;gt; 9999&lt;/span>&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>
&lt;p>When the listener is in a container, you can use the container name as the listener-host.
Or if the listener and the connecting host are on the same host, you can use localhost as the listener-host.&lt;/p></description></item></channel></rss>