Linux Foundations / Read Network Evidence

Inspect addresses and routes without changing them

Lesson 31 of 37. Open to read. No account needed.

An address tells you something about the guest's local configuration. It does not tell you that the guest can reach an intended destination. A route lookup adds another piece of evidence, but still does not show that a packet arrived, a name resolved or an application answered.

You will save actual guest address and route observations in one owned note. Then compare them with supplied examples of a missing route and a different private network. Every network command here is an inspection; you will not create a failure by removing a real route or changing an interface.

1. Build a small vocabulary for the evidence

An interface is a network attachment visible to Linux. A guest can have a virtual network interface as well as loopback, the local path for communication within that same guest. Loopback is not a connection to the VM host or another machine.

An IPv4 address has four decimal parts. A prefix length after / identifies how many leading bits form the network prefix. In the supplied example 192.168.122.23/24, the first 24 bits are the prefix, corresponding here to the first three dotted parts. The associated connected network is 192.168.122.0/24. The address belongs to an interface; the prefix is not an instruction to contact every address in that range.

A route describes where the kernel should send traffic for a destination or destination prefix. A gateway is a next-hop address used on the way to another destination. A default route covers destinations without a more specific applicable route in the ordinary case. It is often displayed as default, representing the IPv4 prefix 0.0.0.0/0.

Private ranges such as the worked 192.168.122.0/24 and later 10.77.4.0/24 belong inside the larger private IPv4 ranges. Their addresses do not by themselves identify publicly reachable services. The selected course setup uses host-side NAT: outbound guest traffic can be translated at that host boundary. Guest address/route observations alone do not prove the host's translation configuration is working.

An illustrative guest interface enp1s0 has address 192.168.122.23/24 and a default route through gateway 192.168.122.1. A host-side gateway and NAT boundary separates the guest from a conceptual later named destination, ubuntu.com. The schematic establishes neither a resolved destination address nor a response or inbound listener.

Read the schematic as the selected course setup's conceptual outbound path. Solid green arrows relate the illustrative interface, route and gateway; the dashed continuation marks the later named-destination question. The guest and gateway values are illustrative, not values to configure or assume on your VM. The later ubuntu.com naming question is separate from this lesson's numeric documentation-address route lookups. No address or response from that named destination is established here. The diagram does not make the guest output evidence of host NAT operation or an inbound service.

2. Check the guest and choose the observation scope

Complete Diagnose the owned service using its journal and settle its cleanup first. Use the ordinary nonzero-UID account in the declared full Ubuntu guest, with its selected NAT setup. Run one command line at a time, inspect the result and stop after an unexpected error. There are no privileged commands, package changes or network probes here.

Inspect the already-taught command origins:

type cd pwd printf set type id ps mkdir ls cat rm rmdir ip
type -a ls
type -P ls

Require the expected Bash builtins and guest utilities. For ls, accept only the understood color-only alias, if present, and expected executable paths; stop for hidden functions or other origins. The ip command must be the expected guest utility, not a custom wrapper or alias. If it is missing, reconcile the declared tool readiness rather than installing anything here.

Then inspect identity, shell and options:

id -u
id -un
ps -p $ -o comm=
ps -p 1 -o comm=
set -o

Require your recorded nonzero account, Bash and the expected full guest's systemd PID 1. Keep the taught errexit-off baseline so an unsuccessful lookup can be interpreted; preserve different settings rather than changing them in this task.

The new network commands use the ip utility, which groups operations by object, such as address or route. Read the scope before reading the output:

FormQuestion it asks
ip -4 -brief address showWhich IPv4 addresses and brief interface states are visible in this guest?
ip -4 route showWhich IPv4 routes are displayed from the default main-table listing?
ip -4 route get 203.0.113.10Which route would the kernel select for this numeric destination in the lookup's current context?

-4 selects IPv4. It does not disable IPv6 or establish anything about IPv6 connectivity. -brief selects compact address output; it changes the display, not the interface. show reads the selected object's information. route get asks for a route decision; it sends no packet to the destination. It is not a promise of no internal lookup/cache effects, and it changes no configured address or route.

The 203.0.113.0/24 range is reserved for documentation. We use numeric .10 and .20 only as harmless route-lookup inputs, not as real services to contact. No DNS lookup is needed for a numeric input. Name resolution, bounded reachability tests and listener evidence belong to later lessons.

3. Create one note for actual observations

The task owns ~/linux-practice/inspect-interfaces-and-routes/ and its single network-evidence.txt file. Inspect the shared parent and prospective task:

ls -ld ~/linux-practice
ls -ld ~/linux-practice/inspect-interfaces-and-routes

Require the ordinary directory owned by your recorded account and the task name absent. Use the resume section for an existing entry. After acceptance:

mkdir ~/linux-practice/inspect-interfaces-and-routes
ls -ld ~/linux-practice/inspect-interfaces-and-routes

Accept its ordinary owned identity, then enter and verify separately:

cd ~/linux-practice/inspect-interfaces-and-routes
pwd
ls -a

Require the exact recorded task path and only dot entries before creating the absent evidence file:

printf '%s\n' 'Guest IPv4 observations' 'Actual address and route evidence; no reachability probe.' > network-evidence.txt
ls -ld -- network-evidence.txt
cat network-evidence.txt

Require an ordinary owned single-link file with exactly those two lines. For every later section, recheck that identity and require each header, append and redirection to succeed. The taught >> file 2>&1 appends stdout and directs stderr to the same destination; it does not promise an arrival order between streams. Save the preceding command's immediate $? before another command replaces it. Retain actual diagnostics and values; never replace them with the supplied successful example below.

4. Observe addresses before drawing a route conclusion

Capture the actual brief IPv4 address report:

printf '%s\n' '--- Actual guest IPv4 addresses ---' >> network-evidence.txt
ip -4 -brief address show >> network-evidence.txt 2>&1
printf 'address query exit: %s\n' "$?" >> network-evidence.txt
cat network-evidence.txt

Require a successful query before interpreting its fields. This is a supplied illustrative report, not your guest's expected exact values:

lo               UNKNOWN        127.0.0.1/8
enp1s0           UP             192.168.122.23/24
PartInterpretation
lo and 127.0.0.1/8Loopback evidence for this guest. It is not the VM host's address.
enp1s0This example's virtual interface name. Actual names may differ.
UPAn operational-state observation, not proof of an end-to-end connection.
UNKNOWNThe operational-state information is not expressed as a known state here; this label alone does not prove failure. Loopback can show it.
192.168.122.23/24The example's assigned IPv4 address and prefix length.

Read your actual rows. Identify loopback separately from each other interface and record the addresses that are actually present. More than one address or interface is possible. Do not rename an interface or replace your values to match the example. No non-loopback IPv4 address is a finding to record, not permission to assign one.

Predict: if the guest has the example address but no route for a remote destination, does its UP label solve the missing route? Keep that question open while collecting the next two observations.

5. Read route entries, then ask about one destination

Capture the actual default main-table IPv4 listing:

printf '%s\n' '--- Actual guest IPv4 main-table routes ---' >> network-evidence.txt
ip -4 route show >> network-evidence.txt 2>&1
printf 'route listing exit: %s\n' "$?" >> network-evidence.txt
cat network-evidence.txt

A successful empty listing is still an observation. It does not mean the query failed. This supplied illustrative listing fits the worked address:

default via 192.168.122.1 dev enp1s0 proto dhcp src 192.168.122.23 metric 100
192.168.122.0/24 dev enp1s0 proto kernel scope link src 192.168.122.23 metric 100
FieldMeaning in this example
defaultBroad fallback destination prefix in this ordinary routing example.
via 192.168.122.1Next-hop gateway, not the final remote destination.
dev enp1s0Interface selected by that route entry.
192.168.122.0/24 ... scope linkA directly connected prefix; traffic for it does not use the example's default gateway route.
src 192.168.122.23Preferred source address associated with the entry. It is not a remote reply.
proto dhcp / proto kernelRoute origin/protocol labels. They do not establish present remote connectivity.
metric 100A route preference value used where applicable. Do not choose a route by comparing this number alone; destination matching and other context matter.

The default main-table display is not every possible Linux route or policy. A missing default row alone does not prove that every destination is unroutable; another specific route or policy may apply. Loopback/local routing information need not appear in this main-table view either. This lesson uses a targeted lookup rather than adding advanced routing commands or changing policy.

Ask the kernel for its selected route to the documentation-only numeric destination, using the current ordinary guest context:

printf '%s\n' '--- Actual route lookup: 203.0.113.10 ---' >> network-evidence.txt
ip -4 route get 203.0.113.10 >> network-evidence.txt 2>&1
printf 'first selected-route query exit: %s\n' "$?" >> network-evidence.txt
cat network-evidence.txt

Read the actual result and status together. A successful lookup can report the destination, via gateway, dev interface and src source address. Extra fields/annotations can vary; preserve them. A uid field, when shown, describes the lookup's user context rather than an account at the destination. A cache annotation is lookup information, not a response packet.

For the worked example, these are selected fields from a supplied successful lookup, not a complete live transcript:

203.0.113.10 via 192.168.122.1 dev enp1s0 src 192.168.122.23

That evidence describes a local route choice for this lookup context. It does not show a reachable gateway, working host NAT, a return path, an allowed application connection or a listening service. A real application can also use a different destination, address family or context. No packet was sent by this route query, and no hostname was resolved.

If the lookup fails, read the actual diagnostic. A kernel route-unreachable result differs from a tool/permission error; neither should be replaced with the example's fields. Preserve the observation and explain its limited scope. Do not add a route, reset an interface or edit host networking.

6. Diagnose the supplied missing-default case

The following is a separate supplied teaching case, not a change to your VM. It retains the same address and connected route. For this case, the shown lookup has no usable route for the selected destination.

Address report:

lo               UNKNOWN        127.0.0.1/8
enp1s0           UP             192.168.122.23/24

Main-table route listing:

192.168.122.0/24 dev enp1s0 proto kernel scope link src 192.168.122.23 metric 100

Result of the supplied numeric 203.0.113.10 route lookup:

RTNETLINK answers: Network is unreachable

The address and UP label did not establish the needed route. The absent default is relevant to the simple displayed setup; the failed targeted lookup is the direct evidence that this lookup context has no route to that numeric destination. It is not a name-resolution failure, because the input was numeric, and it is not a remote service refusal, because no connection probe was made.

Do not reproduce the case by deleting a real default route. Compare its evidence with your actual note and state the difference. In a less simple setup, no default row could coexist with a working specific/policy route; that is why the targeted observation matters.

Independent task: read another private range, then compare reality

These are supplied teaching records for a different guest, not values to configure on yours:

lo               UNKNOWN        127.0.0.1/8
ens3             UP             10.77.4.18/24
default via 10.77.4.1 dev ens3 proto dhcp src 10.77.4.18 metric 100
10.77.4.0/24 dev ens3 proto kernel scope link src 10.77.4.18 metric 100

Selected fields from that guest's supplied lookup:

203.0.113.20 via 10.77.4.1 dev ens3 src 10.77.4.18

Before hints or the answer:

  1. Identify this case's interface, guest address/prefix, connected network and default gateway without reusing the first example's name or range.
  2. Explain what the supplied selected-route result adds and what it still cannot establish about a remote system, name or application.
  3. In your actual guest, repeat the taught route-get form for the second documentation address, 203.0.113.20. Append a newly labelled section, actual output/diagnostics and its immediate status to your note.
  4. Compare actual via/dev/src fields, or the actual error, with your earlier .10 query and with the separate supplied case. Do not claim that your guest has ens3 or 10.77.4.18 unless your real output shows it.

Success: correctly interpret both private-range examples, retain all four actual query sections and statuses, and explain differences without changing configured addresses or routes. A successful route choice is not connectivity proof; an honest failed lookup is useful evidence with a stated scope.

Graduated hints

  1. Read dev, via and src as separate roles. The prefix in the address identifies the connected range; the gateway is not the guest's own address.
  2. The input is numeric and route get sends no packet. Which questions therefore have not been tested?
  3. Reuse the exact capture method with a new header and .20 target. The supplied table is a comparison object, not a source for your actual note.

Answer and Reasoning

The second supplied case uses interface ens3, guest address 10.77.4.18/24, connected network 10.77.4.0/24 and default gateway 10.77.4.1. Its lookup selects that gateway/interface and source address for 203.0.113.20. Those roles remain the same even though every example-specific name and private range changed from the first case.

The route choice adds evidence beyond merely having an address. It does not prove that any packet arrived, that host NAT translated it, that a hostname resolved or that an application listener exists. IPv6 and other lookup/application contexts are also outside these selected IPv4 observations.

After rechecking the actual note's ordinary owned identity and exact task cwd, a complete independent observation is:

printf '%s\n' '--- Actual independent route lookup: 203.0.113.20 ---' >> network-evidence.txt
ip -4 route get 203.0.113.20 >> network-evidence.txt 2>&1
printf 'second selected-route query exit: %s\n' "$?" >> network-evidence.txt
cat network-evidence.txt

Require every append to succeed. Read this actual section before comparing it. The two documentation targets may choose the same route on your guest, but that is an observation to establish rather than assume. If the route, source or state changed, record the difference; do not rewrite the first section or infer an unchanged network from memory.

Your complete note should contain the actual address query, main-table listing and two separately labelled selected-route lookups, with each immediate status. Explain loopback, each relevant non-loopback address, the displayed connected/default route evidence and the targeted outcomes. Keep the supplied no-route and second-range records out of those actual sections. No automatic grading or remote reachability test is implied.

Diagnose a difference without changing the network

ObservationMeaning and next bounded step
Actual interface name differsInterpret its actual row; do not rename it to match a lesson example.
Loopback says UNKNOWNThat label alone is not a failure diagnosis. Read the actual address and separate route evidence.
Non-loopback interface says UPIt still does not prove a route, gateway response or application connection.
No non-loopback IPv4 addressRecord the family-specific local observation and reconcile guest readiness; do not assign an address here.
Main table has no defaultInspect the targeted lookup; missing default alone is not a universal no-route conclusion.
Numeric route lookup reports unreachablePreserve the current-context routing diagnostic; it is not a DNS failure or a remote service response.
Lookup succeeds but another task cannot connectRoute selection was only one layer. Later lessons separately inspect names, bounded responses and listeners.
Tool or permission errorThe intended observation is unavailable; preserve its diagnostic rather than treating it as a network route result.

Cleanup and resume

After the independent comparison and explanation, no network configuration needs restoration because this task changed none. Remove only the owned local note if you no longer need its learning evidence. Recheck the known parents first:

ls -ld ~/linux-practice
ls -ld ~/linux-practice/inspect-interfaces-and-routes

Require ordinary directories owned by your recorded account, then enter and verify separately:

cd ~/linux-practice/inspect-interfaces-and-routes
pwd

Require the exact recorded task path before inspecting the note:

ls -a
ls -ld -- network-evidence.txt
cat network-evidence.txt

Require only the recognized ordinary owned single-link note and dot entries. Preserve an unexpected link, owner, file or unfinished observation. Establish the actual documented interactive response convention; English y/n examples do not justify guessing unfamiliar affirmative responses. After acceptance:

rm -i -- network-evidence.txt

If declined, leave the note and stop cleanup. After accepted removal:

ls -a

Require the task directory empty, then return and verify:

cd ~/linux-practice
pwd

Require the recorded shared-root path before inspecting the task entry:

ls -ld -- inspect-interfaces-and-routes

Only after accepting that ordinary owned empty directory:

rmdir -- inspect-interfaces-and-routes

Retain the shared root and every host/guest network setting. There is no interface, route, firewall, DNS or NAT cleanup command to run.

On interruption, recheck the same guest, ordinary identity, origins, exact cwd and note identity. Read complete captured sections and their statuses. A missing status cannot be reconstructed from a later $?. Append a clearly labelled new observation after a new query, preserving earlier records; network values may change over time. Never insert the supplied fixture into an actual section or rerun an inspection as an excuse to mutate networking.

Sources and other study views

The iproute2 companions document version 6.1.0, the selected Noble family; distribution revisions and output details can differ. The operational-state reference is versioned for Linux 6.8. The Coreutils manual is newer than the selected 9.4 tools; only the bounded, established file/status forms are used. RFC examples define address roles, not evidence that this guest or a remote endpoint has been tested. Interpret the actual guest observations separately from every supplied example.

Revision reconstructs the limits of each observation. Quick Reference retrieves the read-only command forms.

Study this course with an account

Course access adds revision notes, the Quick Reference, saved progress, bookmarks and your own notes.

INR 99 plus 18% GST. 90 days of online access. No auto-renewal.

See course access

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy