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
全部0条评论
快来发表一下你的评论吧 !