title: Could not connect to Redis at 127.0.0.1:6379: Network is unreachable
body: <p>For the past few weeks I have been using a redis server locally on Windows 10 using WSL 2/Ubuntu 20.04 and now suddenly I can't connect to the server anymore. Here is what I usually did in linux terminal that opens when you run ubuntu using wsl 2:</p>
  <pre><code>$ sudo service redis-server start
  $ sudo service redis-server status
  * redis-server running
  </code></pre>
  <p>But now if I try to run the <code>redis-cli</code> command I get this error:</p>
  <pre><code>Could not connect to Redis at 127.0.0.1:6379: Network is unreachable
  </code></pre>
  <p>I have checked  the ip and port using:</p>
  <pre><code>$ ps aux | grep redis
  </code></pre>
  <p>which returns</p>
  <pre><code>redis      190  0.2  0.0  51704  9796 ?        Ssl  17:12   0:00 /usr/bin/redis-server 127.0.0.1:6379
  </code></pre>
  <p>From what I can tell this is telling me that the server is running at 127.0.0.1:6379 yet I cannot connect to it.
  Every post I can find on this kind of issue shows the error as</p>
  <pre><code>Could not connect to Redis at 127.0.0.1:6379: Connection Refused
  </code></pre>
  <p>instead of &quot;network is unreachable&quot; so I'm not sure what the issue is.</p>