<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>networking on Luis Logs</title>
    <link>https://luislogs.com/tags/networking/</link>
    <description>Recent content in networking on Luis Logs</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en-us</language>
    <lastBuildDate>Sat, 28 Oct 2023 12:40:30 +0900</lastBuildDate><atom:link href="https://luislogs.com/tags/networking/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Troubleshooting low throughput on Proxmox</title>
      <link>https://luislogs.com/posts/troubleshooting-my-kubernetes-network/</link>
      <pubDate>Sat, 28 Oct 2023 12:40:30 +0900</pubDate>
      
      <guid>https://luislogs.com/posts/troubleshooting-my-kubernetes-network/</guid>
      <description>When I initially spinned up my k8s cluster, I got everything working but I always experienced network disconnects. it turns out it&amp;rsquo;s due to my NIC. It was quite difficult to notice this or maybe I just really never doubted my hypervisor and the hardware. Eventually I thought of checking the dmesg logs from within proxmox.
Sep 29 14:54:58 pve1 kernel: e1000e 0000:00:1f.6 eno1: Detected Hardware Unit Hang: TDH &amp;lt;22&amp;gt; TDT &amp;lt;bb&amp;gt; next_to_use &amp;lt;bb&amp;gt; next_to_clean &amp;lt;22&amp;gt; buffer_info[next_to_clean]: time_stamp &amp;lt;100cb7acb&amp;gt; next_to_watch &amp;lt;23&amp;gt; jiffies &amp;lt;100cb7d99&amp;gt; next_to_watch.</description>
      <content:encoded><![CDATA[<p>When I initially spinned up my k8s cluster, I got everything working but I always experienced network disconnects. it turns out it&rsquo;s due to my NIC. It was quite difficult to notice this or maybe I just really never doubted my hypervisor and the hardware. Eventually I thought of checking the dmesg logs from within proxmox.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">Sep 29 14:54:58 pve1 kernel: e1000e 0000:00:1f.6 eno1: Detected Hardware Unit Hang:
</span></span><span class="line"><span class="cl">                               TDH                  &lt;22&gt;
</span></span><span class="line"><span class="cl">                               TDT                  &lt;bb&gt;
</span></span><span class="line"><span class="cl">                               next_to_use          &lt;bb&gt;
</span></span><span class="line"><span class="cl">                               next_to_clean        &lt;22&gt;
</span></span><span class="line"><span class="cl">                             buffer_info[next_to_clean]:
</span></span><span class="line"><span class="cl">                               time_stamp           &lt;100cb7acb&gt;
</span></span><span class="line"><span class="cl">                               next_to_watch        &lt;23&gt;
</span></span><span class="line"><span class="cl">                               jiffies              &lt;100cb7d99&gt;
</span></span><span class="line"><span class="cl">                               next_to_watch.status &lt;0&gt;
</span></span><span class="line"><span class="cl">                             MAC Status             &lt;80083&gt;
</span></span><span class="line"><span class="cl">                             PHY Status             &lt;796d&gt;
</span></span><span class="line"><span class="cl">                             PHY 1000BASE-T Status  &lt;3800&gt;
</span></span><span class="line"><span class="cl">                             PHY Extended Status    &lt;3000&gt;
</span></span><span class="line"><span class="cl">                             PCI Status             &lt;10&gt;
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">...
</span></span><span class="line"><span class="cl">Sep 29 14:55:07 pve1 kernel: e1000e 0000:00:1f.6 eno1: Reset adapter unexpectedly
</span></span><span class="line"><span class="cl">Sep 29 14:55:07 pve1 kernel: vmbr0: port 1(eno1) entered disabled state
</span></span><span class="line"><span class="cl">Sep 29 14:55:07 pve1 kernel: vmbr0v20: port 1(eno1.20) entered disabled state
</span></span><span class="line"><span class="cl">Sep 29 14:55:07 pve1 kernel: vmbr0v30: port 1(eno1.30) entered disabled state
</span></span><span class="line"><span class="cl">Sep 29 14:55:11 pve1 kernel: e1000e 0000:00:1f.6 eno1: NIC Link is Up 1000 Mbps Full Duplex, Flow Control: None
</span></span><span class="line"><span class="cl">Sep 29 14:55:11 pve1 kernel: vmbr0: port 1(eno1) entered blocking state
</span></span><span class="line"><span class="cl">Sep 29 14:55:11 pve1 kernel: vmbr0: port 1(eno1) entered forwarding state
</span></span><span class="line"><span class="cl">Sep 29 14:55:11 pve1 kernel: vmbr0v20: port 1(eno1.20) entered blocking state
</span></span><span class="line"><span class="cl">Sep 29 14:55:11 pve1 kernel: vmbr0v20: port 1(eno1.20) entered forwarding state
</span></span><span class="line"><span class="cl">Sep 29 14:55:11 pve1 kernel: vmbr0v30: port 1(eno1.30) entered blocking state
</span></span><span class="line"><span class="cl">Sep 29 14:55:11 pve1 kernel: vmbr0v30: port 1(eno1.30) entered forwarding state
</span></span></code></pre></div><p>When I saw these messages I thought my switch was acting up. I was almost ready to purchase a new switch but then upon further googling I landed in this <a href="https://forum.proxmox.com/threads/e1000-driver-hang.58284/page-10">forum post</a>.</p>
<p>Turns out this specific model is known to be freezing from time to time when segmentation is done by the NIC. This comes enabled by default when installing Proxmox. A quick fix suggeested in the post which worked for me was to simply disable the TSO and GSO flags on the specific interface. On runtime this can be disabled by executing <code>ethtool -K eno1 tso off gso off</code>.</p>
<p>To make the changes permenant, the following line should be added in the /etc/network/interfaces file:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">post-up /usr/bin/logger -p debug -t ifup &#34;Disabling segmentation offload for eno1&#34; &amp;&amp; /sbin/ethtool -K $IFACE tso off gso off &amp;&amp; /usr/bin/logger -p debug -t ifup &#34;Disabled offload for eno1&#34;
</span></span></code></pre></div><p>e.g.</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"></code></pre></div><p>One more issue I faced was very slow throughput when playing videos from Jellyfin.</p>
<p>
    <figure>
      <img loading="lazy" src="/posts/troubleshooting-my-kubernetes-network/proxmox2.png" alt="Low throughput on Proxmox">
      <figcaption>Low throughput on Proxmox</figcaption>
    </figure>
  </p>
<p>Noticed that throughput was very low regardless whether I&rsquo;m using the docker traefik or the one in my kubernetes cluster, while the original traefik container on my Unraid</p>
<p>After drilling down that issue seems to be specific to my Proxmox node, I checked whether the 1Gbit/s speed was properly negotiated as suggested in this other <a href="https://forum.proxmox.com/threads/network-speed-limited-to-100mbit-s.73311/">forum post</a>.</p>
<p>Executing <code>ethtool eno1</code> showed me the following output:</p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">root@pve1:~# ethtool eno1
</span></span><span class="line"><span class="cl">Settings for eno1:
</span></span><span class="line"><span class="cl">	Supported ports: [ TP ]
</span></span><span class="line"><span class="cl">	Supported link modes:   10baseT/Half 10baseT/Full
</span></span><span class="line"><span class="cl">	                        100baseT/Half 100baseT/Full
</span></span><span class="line"><span class="cl">	                        1000baseT/Full
</span></span><span class="line"><span class="cl">	Supported pause frame use: No
</span></span><span class="line"><span class="cl">	Supports auto-negotiation: Yes
</span></span><span class="line"><span class="cl">	Supported FEC modes: Not reported
</span></span><span class="line"><span class="cl">	Advertised link modes:  10baseT/Full
</span></span><span class="line"><span class="cl">	Advertised pause frame use: No
</span></span><span class="line"><span class="cl">	Advertised auto-negotiation: Yes
</span></span><span class="line"><span class="cl">	Advertised FEC modes: Not reported
</span></span><span class="line"><span class="cl">	Speed: 10Mb/s
</span></span><span class="line"><span class="cl">	Duplex: Full
</span></span><span class="line"><span class="cl">	Auto-negotiation: on
</span></span><span class="line"><span class="cl">	Port: Twisted Pair
</span></span><span class="line"><span class="cl">	PHYAD: 1
</span></span><span class="line"><span class="cl">	Transceiver: internal
</span></span><span class="line"><span class="cl">	MDI-X: on (auto)
</span></span><span class="line"><span class="cl">	Supports Wake-on: pumbg
</span></span><span class="line"><span class="cl">	Wake-on: g
</span></span><span class="line"><span class="cl">        Current message level: 0x00000007 (7)
</span></span><span class="line"><span class="cl">                               drv probe link
</span></span><span class="line"><span class="cl">	Link detected: yes
</span></span></code></pre></div><p>Disabled auto-negotiation and configured 1Gbit manually:
<code>ethtool -s eno1 speed 1000 duplex full autoneg off</code></p>
<div class="highlight"><pre tabindex="0" class="chroma"><code class="language-fallback" data-lang="fallback"><span class="line"><span class="cl">root@pve1:~# ethtool eno1
</span></span><span class="line"><span class="cl">Settings for eno1:
</span></span><span class="line"><span class="cl">	Supported ports: [ TP ]
</span></span><span class="line"><span class="cl">	Supported link modes:   10baseT/Half 10baseT/Full
</span></span><span class="line"><span class="cl">	                        100baseT/Half 100baseT/Full
</span></span><span class="line"><span class="cl">	                        1000baseT/Full
</span></span><span class="line"><span class="cl">	Supported pause frame use: No
</span></span><span class="line"><span class="cl">	Supports auto-negotiation: Yes
</span></span><span class="line"><span class="cl">	Supported FEC modes: Not reported
</span></span><span class="line"><span class="cl">	Advertised link modes:  1000baseT/Full
</span></span><span class="line"><span class="cl">	Advertised pause frame use: No
</span></span><span class="line"><span class="cl">	Advertised auto-negotiation: Yes
</span></span><span class="line"><span class="cl">	Advertised FEC modes: Not reported
</span></span><span class="line"><span class="cl">	Speed: 1000Mb/s
</span></span><span class="line"><span class="cl">	Duplex: Full
</span></span><span class="line"><span class="cl">	Auto-negotiation: on
</span></span><span class="line"><span class="cl">	Port: Twisted Pair
</span></span><span class="line"><span class="cl">	PHYAD: 1
</span></span><span class="line"><span class="cl">	Transceiver: internal
</span></span><span class="line"><span class="cl">	MDI-X: off (auto)
</span></span><span class="line"><span class="cl">	Supports Wake-on: pumbg
</span></span><span class="line"><span class="cl">	Wake-on: g
</span></span><span class="line"><span class="cl">        Current message level: 0x00000007 (7)
</span></span><span class="line"><span class="cl">                               drv probe link
</span></span><span class="line"><span class="cl">	Link detected: yes
</span></span></code></pre></div><p>After having these in place, my cluster has been running perfectly fine for almost a month now with nohiccups!</p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Configure port forwarding on your home router</title>
      <link>https://luislogs.com/posts/configure-port-forwarding-on-your-home-router/</link>
      <pubDate>Mon, 20 Mar 2023 18:40:30 +0900</pubDate>
      
      <guid>https://luislogs.com/posts/configure-port-forwarding-on-your-home-router/</guid>
      <description>While setting up Nextcloud on my Unraid server, there was a part where I had to port forward incoming traffic to a reverse proxy. Here I will show you how to set it up on my TP-Link router.
The port forwarding function can be found in Advanced Settings &amp;gt; NAT forwarding &amp;gt; Virtual Server. Do note the name and location of this function can vary between brands and even models of the same brand.</description>
      <content:encoded><![CDATA[<p>While setting up Nextcloud on my Unraid server, there was a part where I had to port forward incoming traffic to a reverse proxy. Here I will show you how to set it up on my TP-Link router.</p>
<p>The port forwarding function can be found in Advanced Settings &gt; NAT forwarding &gt; Virtual Server. Do note the name and location of this function can vary between brands and even models of the same brand.</p>
<p>
    <img src="/posts/configure-port-forwarding-on-your-home-router/router_1.png" alt="alt text">
  </p>
<p>Here I just need to make a new entry to point the external port 443 to my Unraid internal IP with port 1443.</p>
<p>
    <img src="/posts/configure-port-forwarding-on-your-home-router/router_2.png" alt="alt text">
  </p>
<p>To put it simply how this works, anyone who tries to access your public IP address via https or port 443 will be redirected to whatever local IP and port you specify. Now you can try to access your external IP with http or whatever and your connection should be forwarded to the correct service. In the example below nc.su-root.net is pointing to my public IP and internally getting forwarded to Swag.</p>
<p>
    <img src="/posts/configure-port-forwarding-on-your-home-router/router_3.png" alt="alt text">
  </p>
]]></content:encoded>
    </item>
    
    <item>
      <title>Configure Dynamic DNS to reach your home network</title>
      <link>https://luislogs.com/posts/configure-dynamic-dns-to-reach-your-network-at-home/</link>
      <pubDate>Sun, 12 Mar 2023 18:40:30 +0900</pubDate>
      
      <guid>https://luislogs.com/posts/configure-dynamic-dns-to-reach-your-network-at-home/</guid>
      <description>For this first post I want to start with the basic question — how do you reach your server at home with a dynamic public IP? I am almost sure that this is the most asked question when starting with self-hosting especially if you have the mindset of being able to access your environment anytime, anywhere. Well, at least for me, this is the very first question I had in mind when I was just starting back then.</description>
      <content:encoded><![CDATA[<p>For this first post I want to start with the basic question — how do you reach your server at home with a dynamic public IP? I am almost sure that this is the most asked question when starting with self-hosting especially if you have the mindset of being able to access your environment anytime, anywhere. Well, at least for me, this is the very first question I had in mind when I was just starting back then.</p>
<p>For us who don&rsquo;t want to pay more for a static IP, luckily there is a service called dynamic DNS. This is, for most of the time, free and should be supported by most modern home routers.</p>
<h3 id="what-is-dynamic-dns-ddns">What is Dynamic DNS (DDNS)?</h3>
<p>Let me explain this in layman&rsquo;s terms. First, DNS stands for domain name service. A domain is the name you type when you want to access a website such as <a href="https://www.google.com">www.google.com</a> or <a href="https://www.su-root.net">www.su-root.net</a>. Domains will always be mapped to a public IP address as long as it&rsquo;s registered.</p>
<p>Normally, a website will have a static public IP throughout its lifetime unless it is moved to a different server. For websites hosted by hosting companies such as AWS or Bluehost, the mapping of the IP address to a domain name is most of the time managed by them. This is as long as the domain provider is configured to use their nameservers.</p>
<p>For private hosts running behind a normal internet service provider, this is where DDNS comes into picture. If your ISP keeps changing your IP address (e.g. daily or weekly), then DDNS keeps track of this and updates their records automatically (as long as your router supports this feature). This is the best way for people who don&rsquo;t want to acquire a static IP that incur additional costs on their monthly bill.</p>
<h3 id="how-do-you-configure-dynamic-dns">How do you configure Dynamic DNS?</h3>
<p>Now let me walk you through how to configure it with the help of my home router.
Before anything else you need to create an account from a DDNS provider such as no-ip.</p>
<p>
    <img src="/posts/configure-dynamic-dns-to-reach-your-network-at-home/noip.png" alt="alt text">
  </p>
<p>From the Dashboard, go to &gt; Dynamic DNS &gt; No-IP Hostnames then click Create Hostname.</p>
<p>
    <img src="/posts/configure-dynamic-dns-to-reach-your-network-at-home/noip_2.png" alt="alt text">
  </p>
<p>Input your preferred hostname and select any of the free domains. Keep Record Type as DNS Host (A), input your current public IP address, and proceed to create the hostname. You can check your IP here if you don&rsquo;t know it yet.</p>
<p>Next is to configure the DDNS on the router.</p>
<p>What I have is a TP-Link Archer A10 from 3 years ago and it still works perfectly fine without any hiccup. Like I said, most modern routers should support DDNS, but if yours don&rsquo;t and you plan to walk the path of self-hosting, then you can get a new or even a used one for just a couple of bucks.</p>
<p>
    <img src="/posts/configure-dynamic-dns-to-reach-your-network-at-home/router.png" alt="alt text">
  </p>
<p>Login to your router&rsquo;s web GUI. This is, for 99% of the time, the same as your default gateway IP. Mine happens to be &ldquo;http://10.0.0.1&rdquo;. You can also check your current WAN IP from here.</p>
<p>
    <img src="/posts/configure-dynamic-dns-to-reach-your-network-at-home/router2.png" alt="alt text">
  </p>
<p>Next, go to the dynamic DNS configuration. In my case it&rsquo;s under Advanced Settings &gt; Network.
Select NO-IP, input your credentials and the newly created domain. Save.</p>
<p>From here on your router will keep updating your DDNS (No-IP) every time your IP address changes. To verify if your configuration is working, you can do a DNS look up and check if it&rsquo;s correctly mapped to your IP.</p>
<p>
    <img src="/posts/configure-dynamic-dns-to-reach-your-network-at-home/whois.png" alt="alt text">
  </p>
<p>This is the first step to the path of self-hosting and once you have the services running on your server, then you can expose them later on by port forwarding which I will be covering in a different post.</p>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
