Master Curl, Wget, and NMCLI: Essential Linux Operations Commands
This guide introduces essential Linux command‑line tools—curl and wget for data retrieval and file downloading, explains network bonding modes, and provides step‑by‑step nmcli commands to configure bond interfaces and assign IP addresses, offering a concise reference for system administrators.
curl
curlis a command‑line tool for transferring data over protocols such as HTTP, HTTPS, and FTP.
Basic usage
Fetch webpage content: curl http://example.com Download a file: curl -O http://example.com/file.zip Save to a specific filename: curl -o myfile.zip http://example.com/file.zip Test a port: curl -v ip:port Limit download speed:
curl --limit-rate 100K http://example.comwget
wgetis a command‑line downloader supporting HTTP, HTTPS, and FTP.
Basic usage
Download a file: wget http://example.com/file.zip Download and rename: wget -O myfile.zip http://example.com/file.zip Background download: wget -b http://example.com/file.zip Show progress bar: wget --progress=bar http://example.com/file.zip Download specific file types (e.g., PDFs):
wget -r -A pdf http://example.comNetwork bonding (bond)
Bonding combines multiple network interfaces to increase bandwidth or provide redundancy. Common modes:
mode=0 (Round‑robin): distributes outbound traffic evenly across all NICs.
mode=1 (Active‑backup): only one NIC is active; a backup takes over on failure.
mode=2 (XOR): uses MAC‑hash to assign traffic to NICs.
mode=3 (Broadcast): sends packets on all NICs.
mode=4 (802.3ad): LACP dynamic link aggregation.
mode=5 (TLB): adaptive transmit load balancing.
mode=6 (ALB): adaptive load balancing with ARP monitoring.
Configure bond with nmcli
1. Create bond interface
nmcli connection add type bond con-name bond0 ifname bond0 mode active-backup miimon 100
2. Add slave interfaces
nmcli connection add type bond-slave con-name bond0-slave1 ifname ens224 master bond0
nmcli connection add type bond-slave con-name bond0-slave2 ifname ens256 master bond0
3. Set static IP
nmcli connection modify bond0 ipv4.addresses 192.168.5.130/24 ipv4.gateway 192.168.5.1 ipv4.dns "8.8.8.8" ipv4.method manual
4. Enable DHCP
nmcli connection modify bond0 ipv4.method auto
5. Activate connections
nmcli connection up bond0
nmcli connection up bond0-slave1
nmcli connection up bond0-slave2
6. Verify status
cat /proc/net/bonding/bond0Configure a regular NIC IP with nmcli
# List interfaces
nmcli device
# Create connection
nmcli connection add type ethernet ifname eth0 con-name eth0
# Set static IP
nmcli connection modify eth0 ipv4.addresses 192.168.5.110/24
nmcli connection modify eth0 ipv4.gateway 192.168.5.1
nmcli connection modify eth0 ipv4.dns 8.8.8.8
nmcli connection modify eth0 ipv4.method manual
# Enable DHCP
nmcli connection modify eth0 ipv4.method auto
# Show active connections
nmcli connection show --activeSigned-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
MaGe Linux Operations
Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
