<p>If i spawn a pod with </p>

<blockquote>
  <p>hostNetwork: true</p>
</blockquote>

<p>and then attach to it </p>

<blockquote>
  <p>kubectl exec -it my-pod-test bash</p>
</blockquote>

<p>and spawn something silly like </p>

<blockquote>
  <p>nc -l &lt; HOST_IP > 5678</p>
</blockquote>

<p>and netstat shows me</p>

<blockquote>
  <p>tcp 0    0 0.0.0.0:34592    0.0.0.0:*     LISTEN       94/nc</p>
</blockquote>

<p>Why is the random port (in this case) 34592 assigned? Id expect to see port 5678 in use.</p>

<p>Is this a "feature" of Weave, should i go for another networking addon?</p>

<p>More context: I am trying to follow 
<a href="https://www.compoundtheory.com/scaling-dedicated-game-servers-with-kubernetes-part-1-containerising-and-deploying/" rel="nofollow noreferrer">https://www.compoundtheory.com/scaling-dedicated-game-servers-with-kubernetes-part-1-containerising-and-deploying/</a></p>

<p>You don't say what image your pod is running, but I've had this symptom when using the <a href="https://busybox.net/" rel="nofollow noreferrer">busybox</a> <code>nc</code>, as found in images based on <a href="https://hub.docker.com/_/alpine/" rel="nofollow noreferrer">alpine</a> for instance.</p>

<p>As you will see in <a href="https://busybox.net/downloads/BusyBox.html#nc" rel="nofollow noreferrer">the docs</a>, the syntax to listen on a specific port is:</p>

<pre><code>  nc -l -p 5678
</code></pre>

<p>Note that <code>hostNetwork: true</code> bypasses any pod network, so this has nothing to do with <a href="https://www.weave.works/oss/net/" rel="nofollow noreferrer">Weave Net</a> - your pod is running in the host network, just as if it was a process run directly on the host.</p>
