{"id":79083,"date":"2026-11-17T01:54:55","date_gmt":"2026-11-17T01:54:55","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=79083"},"modified":"2026-11-17T01:54:55","modified_gmt":"2026-11-17T01:54:55","slug":"linux-intermediate-07-networking","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=79083","title":{"rendered":"Linux Intermediate 07 \u2014 IP Addresses, Routes, and Name Resolution"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1991\">Linux Intermediate category<\/a> \u00b7 Lesson 7 of 9<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>AI disclosure<\/strong> \u2014 AI-generated content, posted as is. AI can make mistakes. This lesson draws on the linked Open Education posts and adds original explanations or lab examples where useful. The newly written explanations and examples may be freely reused. Linked source material retains its own terms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Learning goal<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Separate the problems of link state, addressing, routing, name resolution, and listening services.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Concepts and setup<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The site&#8217;s networking posts compare legacy ifconfig and modern ip commands, and show a Netplan static-address example. This lab inspects live settings without changing them. Save a snapshot and use the VM console before remote address changes. An interface may be up without an IPv4 address, and a hostname may fail while a numeric IP still works.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A host-only network is suitable for services that must not leak onto a shared LAN. A separate NAT adapter can give the VM package access. Track which adapter handles each role.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Trace a route and inspect name resolution<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>ip -br link\nip -br address\nip route show default\nip route get 198.51.100.20\ngetent hosts localhost\nss -ltn<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>lo               UNKNOWN ...\nenp0s3           UP ...\nlo               UNKNOWN        127.0.0.1\/8 ::1\/128\nenp0s3           UP             10.0.2.15\/24\ndefault via 10.0.2.2 dev enp0s3\n198.51.100.20 via 10.0.2.2 dev enp0s3 src 10.0.2.15 ...\n::1             localhost\nState  Recv-Q Send-Q Local Address:Port Peer Address:Port\nLISTEN 0      128        127.0.0.1:8000      0.0.0.0:*<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">198.51.100.20 is a documentation address. ip route get asks the kernel what it would choose and does not send traffic. ss -ltn shows local TCP listeners without resolving names.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Read-only persistence checks on a managed system<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code># Ubuntu using Netplan, where installed:\nsudo netplan get\n# Red Hat-family using NetworkManager, where installed:\nnmcli device status<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Possible output<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>network:\n  version: 2\n  ethernets:\n    enp0s3:\n      dhcp4: true\n...\nDEVICE   TYPE      STATE      CONNECTION\nens33    ethernet  connected  lab-nat<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Use the command for your lab, not both blindly. Before modifying a remote host, plan console access. On Ubuntu, netplan try can offer a timed configuration rollback, but do not rely on it as your only recovery path.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Questions only<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>What does a default route do?<\/li>\n\n\n<li>Does a listener on 127.0.0.1 accept connections from another VM?<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment questions<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>A client reaches a numeric server address but not its hostname. What would you check?<\/li>\n\n\n<li>What command shows which outgoing interface the kernel would choose?<\/li>\n\n\n<li>Show evidence that a connection refusal is from a missing listener rather than a guess.<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Questions and answers<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Quick-check answers<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>What does a default route do?<\/strong><br><strong>Answer<\/strong> \u2014 It is the fallback route when a more specific route does not match.<\/li>\n\n\n<li><strong>Does a listener on 127.0.0.1 accept connections from another VM?<\/strong><br><strong>Answer<\/strong> \u2014 Not directly. The 127.0.0.1 address is loopback in that host&#8217;s network namespace.<\/li>\n\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">Assessment answer key<\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><strong>A client reaches a numeric server address but not its hostname. What would you check?<\/strong><br><strong>Answer<\/strong> \u2014 Compare getent hosts for the real hostname with the intended resolver configuration and DNS response. Check \/etc\/hosts and resolver precedence as relevant.<\/li>\n\n\n<li><strong>What command shows which outgoing interface the kernel would choose?<\/strong><br><strong>Answer<\/strong> \u2014 ip route get ADDRESS. Substitute the real destination for your lab.<\/li>\n\n\n<li><strong>Show evidence that a connection refusal is from a missing listener rather than a guess.<\/strong><br><strong>Answer<\/strong> \u2014 Check ss -ltn on the server for the intended address and port. Then correlate the client attempt and server state. A firewall can also reject a connection.<\/li>\n\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Source articles on this site<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78439\">Basic Commands for Networking in Linux<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78615\">How to assign a Static IP address to an Ubuntu Box<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=67594\">Network Interface, Network Clients related Linux\/Redhat\/CentOS commands #DevOps #RHCSA<\/a><\/li>\n\n\n<li><a href=\"https:\/\/bangla.sitestree.com\/?p=78732\">Understanding Host-Only Networking in Oracle VirtualBox: Concepts, Tools, IP Addressing, DHCP, and Practical Options<\/a><\/li>\n\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Continue the course<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Previous lesson 06 \u2014 Boot, Services, Logs, and Timers. Next lesson 08 \u2014 SSH Keys, Host Identity, and File Transfer.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/bangla.sitestree.com\/?name=linux-course-index\">Linux course index<\/a> \u00b7 <a href=\"https:\/\/bangla.sitestree.com\/?cat=1991\">Linux Intermediate category<\/a> \u00b7 Lesson 7 of 9<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Separate the problems of link state, addressing, routing, name resolution, and listening services.<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1991],"tags":[],"class_list":["post-79083","post","type-post","status-publish","format-standard","hentry","category-linux-intermediate","item-wrap"],"jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":79084,"url":"http:\/\/bangla.sitestree.com\/?p=79084","url_meta":{"origin":79083,"position":0},"title":"Linux Intermediate 08 \u2014 SSH Keys, Host Identity, and File Transfer","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Verify an SSH host\u2019s identity, use a passphrase-protected key, and transfer a non-sensitive file.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79102,"url":"http:\/\/bangla.sitestree.com\/?p=79102","url_meta":{"origin":79083,"position":1},"title":"Linux Administration Course \u2014 Start Here and Lesson Index","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"A 33-lesson Linux course from shell fundamentals to server administration, performance, and a recovery capstone.","rel":"","context":"In &quot;Linux Basics&quot;","block_context":{"text":"Linux Basics","link":"http:\/\/bangla.sitestree.com\/?cat=1990"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79082,"url":"http:\/\/bangla.sitestree.com\/?p=79082","url_meta":{"origin":79083,"position":2},"title":"Linux Intermediate 06 \u2014 Boot, Services, Logs, and Timers","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Trace the boot-to-service path, inspect logs, and create a timer that runs a tiny user service.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79085,"url":"http:\/\/bangla.sitestree.com\/?p=79085","url_meta":{"origin":79083,"position":3},"title":"Linux Intermediate 09 \u2014 Block Devices, Filesystems, and Mounts","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Distinguish a block device from a filesystem and a mount point, and inspect each layer without changing it.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79080,"url":"http:\/\/bangla.sitestree.com\/?p=79080","url_meta":{"origin":79083,"position":4},"title":"Linux Intermediate 04 \u2014 Bash Conditions, Loops, Functions, and Debugging","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Use a case statement, a function, and a loop to generate a multiplication chart and test invalid input.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":79081,"url":"http:\/\/bangla.sitestree.com\/?p=79081","url_meta":{"origin":79083,"position":5},"title":"Linux Intermediate 05 \u2014 Package Managers and Repositories","author":"Sayed","date":"November 17, 2026","format":false,"excerpt":"Inspect installed packages and repositories before taking action, and tell a package database from a dependency resolver.","rel":"","context":"In &quot;Linux Intermediate&quot;","block_context":{"text":"Linux Intermediate","link":"http:\/\/bangla.sitestree.com\/?cat=1991"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"jetpack_featured_media_url":"","_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=79083"}],"version-history":[{"count":0,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/79083\/revisions"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=79083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=79083"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=79083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}