{"id":180,"date":"2023-07-04T21:10:10","date_gmt":"2023-07-05T05:10:10","guid":{"rendered":"https:\/\/www.dumpsterfirecomputing.com\/?p=180"},"modified":"2023-07-04T21:10:10","modified_gmt":"2023-07-05T05:10:10","slug":"down-the-rabbit-hole-networking-part-2","status":"publish","type":"post","link":"https:\/\/www.dumpsterfirecomputing.com\/?p=180","title":{"rendered":"Down the Rabbit Hole &#8211; Networking (Part 2)"},"content":{"rendered":"\n<p>I know it&#8217;s been a day or two since the first part of this, but here we are.  Part two where I go down the rabbit hole of basic network troubleshooting between a client and a server.  The intent here is to start at the absolute beginning and walk through a simple scenario between two machines.  I&#8217;ll be working with a few tools, and pointing at a few spots where things can go wrong.<\/p>\n\n\n\n<p>Let&#8217;s start with the network.  Here&#8217;s the design of our sample network:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"346\" height=\"445\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-3.png\" alt=\"\" class=\"wp-image-185\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-3.png 346w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-3-233x300.png 233w\" sizes=\"auto, (max-width: 346px) 100vw, 346px\" \/><\/figure>\n\n\n\n<p>There is a single Virtual Network called VNET-TEST with a single subnet called SUBNET-VMS.  Attached to that subnet are two virtual machines (VM1 and SERVER01).  Each Virtual Machine has a NIC with a private IP address.  Each NIC also has a Public IP Address associated with it.  Lastly, I have a basic Network Security Group attached to both virtual machine NIC&#8217;s that is allowing TCP Port 3389 inbound, as well as allowing Ping and HTTP within the subnet.  This creates a simple two VM network that we can RDP into from the outside.  If you&#8217;d like to build this yourself, <a href=\"https:\/\/github.com\/TheRickOlson\/NetworkingPart2\" target=\"_blank\" rel=\"noreferrer noopener\">I have some bicep code<\/a> you can use as a template.<\/p>\n\n\n\n<p>From the server, we want to reach TCP port 80.  But rather than install a full blown web server, I&#8217;m going to use PowerShell to open a specific port.  I&#8217;ve found this method invaluable in quickly simulating or testing port connectivity between two basic endpoints (when doing firewall troubleshooting).  So, the following code is run from the server:<br><\/p>\n\n\n\n<figure class=\"wp-block-image size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-2.png\" alt=\"\" class=\"wp-image-183\" width=\"692\" height=\"84\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-2.png 494w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-2-300x36.png 300w\" sizes=\"auto, (max-width: 692px) 100vw, 692px\" \/><\/figure>\n\n\n\n<p>This will open TCP Port 80 on the local IP Address to be listening for connections.  Now we turn our attention to the client and begin to introduce our first tool<\/p>\n\n\n\n<p class=\"has-larger-font-size\">Ping<\/p>\n\n\n\n<p>Ping is&#8230;basic.  It&#8217;s basic and not always reliable, but it should always be one of your first tools in your arsenal.  There are only two conditions with ping &#8211; works or it doesn&#8217;t.  Here&#8217;s an example of ping not working:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"414\" height=\"193\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-4.png\" alt=\"\" class=\"wp-image-186\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-4.png 414w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-4-300x140.png 300w\" sizes=\"auto, (max-width: 414px) 100vw, 414px\" \/><\/figure>\n\n\n\n<p>The most common reason for the above is a firewall of some kind blocking ICMP (Ping) traffic.  Many servers and network appliances will block or drop ICMP traffic.  In our case, it&#8217;s actually firewall related.  Windows Server installations, by default, enable the internal Firewall <em>and <\/em>block inbound ICMP:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"562\" height=\"234\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-5.png\" alt=\"\" class=\"wp-image-187\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-5.png 562w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-5-300x125.png 300w\" sizes=\"auto, (max-width: 562px) 100vw, 562px\" \/><\/figure>\n\n\n\n<p>The above is shown in the Advanced Firewall settings within Windows Server.  By simply enabling the inbound ICMP Allow rules we can see that we can now ping the server properly:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"524\" height=\"178\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-6.png\" alt=\"\" class=\"wp-image-188\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-6.png 524w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-6-300x102.png 300w\" sizes=\"auto, (max-width: 524px) 100vw, 524px\" \/><\/figure>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"389\" height=\"213\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-7.png\" alt=\"\" class=\"wp-image-189\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-7.png 389w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-7-300x164.png 300w\" sizes=\"auto, (max-width: 389px) 100vw, 389px\" \/><\/figure>\n\n\n\n<p class=\"has-larger-font-size\">Trace Route<\/p>\n\n\n\n<p>Trace Route (or TraceRt) is a tool used to see how many &#8220;hops&#8221; are between your source and destination machines.  This can be useful in identifying routing problems.  It leverages ping and DNS.  In our network, there are no routers, firewalls, VPN&#8217;s or other devices to hop through, so when we trace route to our server we get a simple result:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"492\" height=\"127\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-8.png\" alt=\"\" class=\"wp-image-190\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-8.png 492w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-8-300x77.png 300w\" sizes=\"auto, (max-width: 492px) 100vw, 492px\" \/><\/figure>\n\n\n\n<p>This basically says that anytime the client is communicated with the server, it&#8217;s direct.  There&#8217;s nothing in between the two that can block or filter the traffic.<\/p>\n\n\n\n<p>What&#8217;s something more complicated look like?  Well here&#8217;s what it looks like to trace our route through to www.bing.com:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"392\" height=\"284\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-9.png\" alt=\"\" class=\"wp-image-191\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-9.png 392w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-9-300x217.png 300w\" sizes=\"auto, (max-width: 392px) 100vw, 392px\" \/><\/figure>\n\n\n\n<p>There are 12 devices between my client and the server that responded to www.bing.com.  None of those devices are responding directly to ICMP (thus the &#8220;Request timed out&#8221; messages), but we know there&#8217;s something there.<\/p>\n\n\n\n<p class=\"has-larger-font-size\">Test-NetConnection<\/p>\n\n\n\n<p>So those were basic tools to help us test whether the server is alive and how far it is &#8211; next up is this PowerShell cmdlet.  By passing just the server name, we&#8217;re essentially performing the PowerShell equivalent of ping:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"353\" height=\"161\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-10.png\" alt=\"\" class=\"wp-image-192\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-10.png 353w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-10-300x137.png 300w\" sizes=\"auto, (max-width: 353px) 100vw, 353px\" \/><\/figure>\n\n\n\n<p>But this cmdlet can actually help us test whether that server is responding on TCP port 80 by adding the Port parameter:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"426\" height=\"158\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-11.png\" alt=\"\" class=\"wp-image-193\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-11.png 426w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-11-300x111.png 300w\" sizes=\"auto, (max-width: 426px) 100vw, 426px\" \/><\/figure>\n\n\n\n<p>If this fails, things to look for will be either something blocking that traffic in transit (like a Firewall) or checking that the server is truly listening on port 80 (usually with netstat on the server itself).<\/p>\n\n\n\n<p>Test-NetConnection is a great tool with a few useful options such as performing trace routes, getting detailed information from the remote host, and performing certain diagnostics.  Full documentation on the use of this cmdlet can be found <a href=\"https:\/\/learn.microsoft.com\/en-us\/powershell\/module\/nettcpip\/test-netconnection?view=windowsserver2022-ps\" target=\"_blank\" rel=\"noreferrer noopener\">here<\/a>.<\/p>\n\n\n\n<p class=\"has-larger-font-size\">PSPing<\/p>\n\n\n\n<p>Lastly we have PSPing, which is part of the <a rel=\"noreferrer noopener\" href=\"https:\/\/learn.microsoft.com\/en-us\/sysinternals\/downloads\/sysinternals-suite\" target=\"_blank\">Sysinternals Suite<\/a> of tools.  This tool takes things to the next level, by allowing us to set up a constant &#8220;ping&#8221; to the server on port 80.  The syntax is simple &#8211; we tack the port number to the end of the IP address we want to target, separated by a colon:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"507\" height=\"281\" src=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-12.png\" alt=\"\" class=\"wp-image-194\" srcset=\"https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-12.png 507w, https:\/\/www.dumpsterfirecomputing.com\/wp-content\/uploads\/2023\/07\/image-12-300x166.png 300w\" sizes=\"auto, (max-width: 507px) 100vw, 507px\" \/><\/figure>\n\n\n\n<p>This shows 5 successful connections to port 80 on our server.  The tool has a variety of other options for performing latency or bandwidth tests, adjusting the payload size, running until manually stopped, etc.  Full documentation can be found <a href=\"https:\/\/learn.microsoft.com\/en-us\/sysinternals\/downloads\/psping\" target=\"_blank\" rel=\"noreferrer noopener\">here <\/a>&#8211; this is a tool worth knowing and using.<\/p>\n\n\n\n<p class=\"has-larger-font-size\">Summary<\/p>\n\n\n\n<p>I&#8217;ve taken all of these tools for granted over the years, making wild assumptions that everyone knows about them and how to use them.  The reality is that not everyone does.  These basic tools and skills are invaluable, and sometimes they&#8217;re overlooked when people troubleshoot a server \/ site \/ service is unresponsive.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I know it&#8217;s been a day or two since the first part of this, but here we are. Part two where I go down the rabbit hole of basic network [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39,24,33],"tags":[27],"class_list":["post-180","post","type-post","status-publish","format-standard","hentry","category-network","category-troubleshooting","category-windows-server","tag-troubleshooting"],"_links":{"self":[{"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=\/wp\/v2\/posts\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=180"}],"version-history":[{"count":2,"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=\/wp\/v2\/posts\/180\/revisions"}],"predecessor-version":[{"id":195,"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=\/wp\/v2\/posts\/180\/revisions\/195"}],"wp:attachment":[{"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dumpsterfirecomputing.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}