curl
curl 是一個(gè)用于與服務(wù)器進(jìn)行數(shù)據(jù)傳輸?shù)拿钚泄ぞ?。它支持多種協(xié)議,包括 HTTP、HTTPS、 FTP 等。
基本用法
獲取網(wǎng)頁內(nèi)容:
curl http://example.com
下載文件:
curl -O http://example.com/file.zip
保存文件到指定名稱:
curl -o myfile.zip http://example.com/file.zip
測(cè)試端口:
curl -v ip:端口
限制下載速度:
curl --limit-rate 100K http://example.com
wget
wget 是一個(gè)用于從網(wǎng)絡(luò)下載文件的命令行工具,支持 HTTP、HTTPS 和 FTP 協(xié)議
基本用法
下載文件:
wget http://example.com/file.zip
下載并保存為指定文件名:
wget -O myfile.zip http://example.com/file.zip
后臺(tái)下載:
wget -b http://example.com/file.zip
顯示下載進(jìn)度:
wget --progress=bar http://example.com/file.zip
5.顯示下載進(jìn)度:
wget --progress=bar http://example.com/file.zip
下載指定格式的文件(例如,下載所有 PDF 文件):
wget -r -A pdf http://example.com
bond
mode=0 (Round-robin):
輪詢模式,將出站流量均勻分配到所有網(wǎng)卡上,提高帶寬。
主備模式,只有一張網(wǎng)卡處于活動(dòng)狀態(tài),另一張作為備份,若活動(dòng)網(wǎng)卡失效則切換到備份。
mode=2 (XOR):
異或模式,根據(jù) MAC 地址的哈希值將流量分配到不同的網(wǎng)卡上。
mode=3 (Broadcast):
廣播模式,所有數(shù)據(jù)包都會(huì)被發(fā)送到所有網(wǎng)卡,提供高可用性但沒有帶寬提升。
mode=4 (802.3ad):
動(dòng)態(tài)鏈接聚合模式,使用 LACP(鏈路聚合控制協(xié)議),能夠動(dòng)態(tài)地將多個(gè)網(wǎng)卡聚合在一起。
mode=5 (TLB - Adaptive Transmit Load Balancing):
自適應(yīng)傳輸負(fù)載均衡模式,出站流量根據(jù)負(fù)載情況動(dòng)態(tài)分配,入站流量使用主網(wǎng)卡。
mode=6 (ALB - Adaptive Load Balancing):
自適應(yīng)負(fù)載均衡模式,結(jié)合 TLB 和 ARP 監(jiān)控,提供出站和入站流量的負(fù)載均衡。
nmcli 配置bond
1.創(chuàng)建綁定接口
nmcli connection add type bond con-name bond0 ifname bond0 mode active-backup miimon 100
miimon 是監(jiān)測(cè)間隔(毫秒),可以根據(jù)需要調(diào)整。
2.添加網(wǎng)卡到綁定接口
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.配置靜態(tài) 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.檢查綁定狀態(tài)
cat /proc/net/bonding/bond0
nmcli給普通網(wǎng)卡配置ip
1.查看可用的網(wǎng)絡(luò)接口:
nmcli device
2.創(chuàng)建一個(gè)新的連接
nmcli connection add type ethernet ifname eth0 con-name eth0
3.配置靜態(tài)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.查看狀態(tài)
nmcli connection show --active
鏈接:https://www.cnblogs.com/cloudwangsa/p/18563737
-
命令
+關(guān)注
關(guān)注
5文章
696瀏覽量
22108 -
Curl
+關(guān)注
關(guān)注
0文章
17瀏覽量
8204
原文標(biāo)題:curl wget bond:深入解析命令行工具的差異與應(yīng)用場(chǎng)景
文章出處:【微信號(hào):magedu-Linux,微信公眾號(hào):馬哥Linux運(yùn)維】歡迎添加關(guān)注!文章轉(zhuǎn)載請(qǐng)注明出處。
發(fā)布評(píng)論請(qǐng)先 登錄
相關(guān)推薦
評(píng)論