curl
curl
是一個用於與伺服器進行資料傳輸的命令列工具。它支援多種協議,包括 HTTP、HTTPS、 FTP 等。基本用法
獲取網頁內容:
curl http://example.com
下載檔案:
curl -O http://example.com/file.zip
儲存檔案到指定名稱:
curl -o myfile.
zip
http://example.com/file.
zip
測試埠:
curl
-v
ip
:埠
限制下載速度:
curl --limit-rate 100K http://example.com
wget
wget
是一個用於從網路下載檔案的命令列工具,支援 HTTP、HTTPS 和 FTP 協議基本用法
-
下載檔案:wget http://example.com/file.zip
-
下載並儲存為指定檔名:wget -O myfile.
zip
http://example.com/file.zip
-
後臺下載:
wget
-b
http://example.com/file.zip
-
顯示下載進度:wget --progress=bar http://example.com/file.zip
5.顯示下載進度:
wget --progress=bar http://example.com/file.zip
-
下載指定格式的檔案(例如,下載所有 PDF 檔案):wget -r -A pdf http://example.com
bond
-
mode=0 (Round-robin):
-
輪詢模式,將出站流量均勻分配到所有網絡卡上,提高頻寬。
-
mode=1 (Active-backup):
-
主備模式,只有一張網絡卡處於活動狀態,另一張作為備份,若活動網絡卡失效則切換到備份。
-
mode=2 (XOR):
-
異或模式,根據 MAC 地址的雜湊值將流量分配到不同的網絡卡上。
-
mode=3 (Broadcast):
-
廣播模式,所有資料包都會被髮送到所有網絡卡,提供高可用性但沒有頻寬提升。
-
mode=4 (802.3ad):
-
動態連結聚合模式,使用 LACP(鏈路聚合控制協議),能夠動態地將多個網絡卡聚合在一起。
-
mode=5 (TLB – Adaptive Transmit Load Balancing):
-
自適應傳輸負載均衡模式,出站流量根據負載情況動態分配,入站流量使用主網絡卡。
-
mode=6 (ALB – Adaptive Load Balancing):
-
自適應負載均衡模式,結合 TLB 和 ARP 監控,提供出站和入站流量的負載均衡。
nmcli 配置bond
1.建立繫結介面
nmcli connection add type bond con-name bond0 ifname bond0 mode active-backup miimon 100
miimon 是監測間隔(毫秒),可以根據需要調整。
2.新增網絡卡到繫結介面
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.配置靜態 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.配置dhcp
nmcli connection modify bond0 ipv4.method auto
5.啟用連結
nmcli connection up bond0
nmcli connection up bond0-slave1
nmcli connection up bond0-slave2
6.檢查繫結狀態
cat /proc/net/bonding/bond0
nmcli給普通網絡卡配置ip
1.檢視可用的網路介面:
nmcli device
2.建立一個新的連線
nmcli connection add type ethernet ifname eth0 con-name eth0
3.配置靜態IP地址
nmcli connection modify ens8 ipv4.addresses 192.168.5.110/24
nmcli connection modify ens8 ipv4.gateway 192.168.5.1
nmcli connection modify ens8 ipv4.dns 8.8.8.8
nmcli connection modify ens8 ipv4.method manual
4.配置dhcp
nmcli connection modify my-ethernet ipv4.method auto
5.檢視狀態
nmcli connection show --active
連結:https://www.cnblogs.com/cloudwangsa/p/18563737
(版權歸原作者所有,侵刪)

文末福利

即將步入2025年,不少小夥伴在考慮來年的工作方向。
僅目前來說,傳統運維衝擊年薪30W+的轉型方向就是SRE&DevOps崗位。

為了幫助大家早日擺脫繁瑣的基層運維工作,給大家整理了一套【2024最新運維資料】高階運維工程師必備技能資料包(文末一鍵領取),內容有多詳實豐富看下圖!
共有 20 個模組





······



以上所有資料獲取請掃碼

識別上方二維碼
備註:2024最新運維資料
100%免費領取
(是掃碼領取,不是在公眾號後臺回覆,別看錯了哦)