0
0
Linux CLIscripting~10 mins

Why network tools diagnose connectivity in Linux CLI - Test Your Understanding

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to check if a host is reachable using ping.

Linux CLI
ping -c 4 [1]
Drag options to blanks, or click blank then click option'
A-t
B-v
Clocalhost
Dgoogle.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using options like -v or -t instead of a hostname.
Leaving the host blank.
2fill in blank
medium

Complete the command to display the current network interfaces and their IP addresses.

Linux CLI
ip [1]
Drag options to blanks, or click blank then click option'
Aaddr
Broute
Clink
Dconfig
Attempts:
3 left
💡 Hint
Common Mistakes
Using ip route which shows routing tables.
Using ip link which shows interfaces but not IP addresses.
3fill in blank
hard

Fix the error in the command to trace the route packets take to reach a host.

Linux CLI
traceroute [1]
Drag options to blanks, or click blank then click option'
A-n
Bgoogle.com
C-c 4
Dlocalhost
Attempts:
3 left
💡 Hint
Common Mistakes
Using options like -n or -c without specifying a host.
Leaving the host blank.
4fill in blank
hard

Fill both blanks to create a command that shows active network connections and listening ports.

Linux CLI
netstat [1] [2]
Drag options to blanks, or click blank then click option'
A-t
B-u
C-l
D-a
Attempts:
3 left
💡 Hint
Common Mistakes
Using only -t or -u which show TCP or UDP but not all connections.
Mixing options that don't show listening ports.
5fill in blank
hard

Fill all three blanks to create a dictionary comprehension that maps interface names to their IP addresses if the IP is IPv4.

Linux CLI
interfaces = { [1]: [2] for [3], [2] in ip_addr.items() if '.' in [2] }
Drag options to blanks, or click blank then click option'
Aiface
Bip
Dip_addr
Attempts:
3 left
💡 Hint
Common Mistakes
Using the same variable name for key and value.
Not filtering for IPv4 addresses.