124 lines
3.0 KiB
EmacsLisp
124 lines
3.0 KiB
EmacsLisp
;;; 102-network-tools-lesson.el --- network-tools-lesson
|
|
|
|
(defun network-tools-lesson ()
|
|
"Linux+ lesson for network troubleshooting tools."
|
|
(interactive)
|
|
|
|
(delete-other-windows)
|
|
|
|
(let ((buf (get-buffer-create "*Network Tools Lesson*"))
|
|
(shell (or shell-file-name
|
|
(getenv "SHELL")
|
|
"/bin/sh")))
|
|
|
|
(switch-to-buffer buf)
|
|
|
|
(read-only-mode -1)
|
|
(erase-buffer)
|
|
|
|
(insert
|
|
"Linux+ Lesson: Network Troubleshooting Tools\n"
|
|
"============================================\n\n"
|
|
|
|
"Concept:\n"
|
|
"Linux administrators must diagnose network problems quickly.\n"
|
|
"CompTIA Linux+ expects familiarity with modern networking tools,\n"
|
|
"basic connectivity testing, interface inspection, DNS testing,\n"
|
|
"and socket/process inspection.\n\n"
|
|
|
|
"Core commands:\n\n"
|
|
|
|
"ip addr\n"
|
|
" Display IP address information.\n\n"
|
|
|
|
"ip route\n"
|
|
" Display routing table.\n\n"
|
|
|
|
"ping\n"
|
|
" Test ICMP connectivity.\n\n"
|
|
|
|
"ss -tulpn\n"
|
|
" Show listening TCP/UDP sockets and associated processes.\n\n"
|
|
|
|
"hostnamectl\n"
|
|
" Show or change persistent hostname.\n\n"
|
|
|
|
"dig\n"
|
|
" Query DNS servers.\n\n"
|
|
|
|
"traceroute\n"
|
|
" Show network path hops.\n\n"
|
|
|
|
"curl\n"
|
|
" Retrieve data from URLs and test HTTP services.\n\n"
|
|
|
|
"wget\n"
|
|
" Download files from remote systems.\n\n"
|
|
|
|
"nmap\n"
|
|
" Network discovery and port scanning.\n\n"
|
|
|
|
"Hands-on tasks:\n\n"
|
|
|
|
"1. Display IP addresses:\n"
|
|
" ip addr\n\n"
|
|
|
|
"2. Display routes:\n"
|
|
" ip route\n\n"
|
|
|
|
"3. Test connectivity:\n"
|
|
" ping -c 4 google.com\n\n"
|
|
|
|
"4. Inspect listening services:\n"
|
|
" ss -tulpn\n\n"
|
|
|
|
"5. Query DNS:\n"
|
|
" dig google.com\n\n"
|
|
|
|
"6. Download a webpage:\n"
|
|
" curl https://example.com\n\n"
|
|
|
|
"7. Download a file:\n"
|
|
" wget https://example.com/index.html\n\n"
|
|
|
|
"8. Display hostname:\n"
|
|
" hostnamectl\n\n"
|
|
|
|
"9. Run a localhost scan:\n"
|
|
" sudo nmap localhost\n\n"
|
|
|
|
"Important Linux+ exam traps:\n\n"
|
|
|
|
"- `ip` replaces many older networking tools.\n"
|
|
"- `ss` is preferred over `netstat` on modern systems.\n"
|
|
"- `dig` is for DNS lookups.\n"
|
|
"- `ping` uses ICMP.\n"
|
|
"- `curl` is commonly used for API and HTTP testing.\n"
|
|
"- `wget` is commonly used for recursive or file downloads.\n"
|
|
"- `nmap` is heavily associated with network discovery and auditing.\n"
|
|
"- `hostnamectl` changes persistent hostnames.\n\n"
|
|
|
|
"Debian/Rocky notes:\n\n"
|
|
|
|
"- `dig` may require package installation.\n"
|
|
"- Debian package: dnsutils\n"
|
|
"- Rocky package: bind-utils\n\n"
|
|
|
|
"When finished, run:\n\n"
|
|
"M-x network-tools-quiz\n")
|
|
|
|
(goto-char (point-min))
|
|
(view-mode 1)
|
|
|
|
(split-window-below)
|
|
(other-window 1)
|
|
|
|
(let ((term (get-buffer "*term*")))
|
|
(if (buffer-live-p term)
|
|
(switch-to-buffer term)
|
|
(ansi-term shell "term")))
|
|
|
|
(other-window -1)))
|
|
|
|
;;; 102-network-tools-lesson.el ends here
|