部署iperf2运行定时任务,两台服务器进行互相拉流

vi /etc/yum.repos.d/CentOS-Base.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-7 - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#released updates 
[updates]
name=CentOS-7 - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that may be useful
[extras]
name=CentOS-7 - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-7 - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
 
#contrib - packages by Centos Users
[contrib]
name=CentOS-7 - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/7/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7
yum clean all
yum makecache
yum install iptraf -y
iptraf-ng

yum install -y epel-release  #先安装epel软件库
yum install -y nload         #再安装nload
nload -m  -u H ens4 ens4d1 ens6 ens6d1 bond0
wget https://iperf.fr/download/fedora/iperf-2.0.8-2.fc23.x86_64.rpm --no-check-certificate
rpm -ivh iperf-2.0.8-2.fc23.x86_64.rpm 
yum install crontabs -y
systemctl enable crond
systemctl start crond
vi /etc/crontab
29 1 * * * root killall -9 iperf3
29 1 * * * root killall -9 iperf
30 1 * * * root sh /etc/iperf.sh
vi /etc/iperf.sh
nohup iperf -c 2408:8001:*****:3:f -p 6666 -V -t 10000000 >/dev/null 2>&1 &
nohup iperf -c 2408:8001:*****:3:f -p 6667 -V -t 10000000 >/dev/null 2>&1 &
nohup iperf -c 2408:8001:*****:3:f -p 6668 -V -t 10000000 >/dev/null 2>&1 &
nohup iperf -c 2408:8001:*****:3:f -p 6669 -V -t 10000000 >/dev/null 2>&1 &
nohup iperf -s -V -p 5001 -D &
nohup iperf -s -V -p 5002 -D &
nohup iperf -s -V -p 5003 -D &
nohup iperf -s -V -p 5004 -D &
nohup iperf -s -V -p 5005 -D &
nohup iperf -s -V -p 5006 -D &
nohup iperf -s -V -p 5007 -D &
nohup iperf -s -V -p 5008 -D &
nohup iperf -s -V -p 5009 -D &
nohup iperf -s -V -p 5010 -D &
chown 755 /etc/iperf.sh
chmod +x /etc/iperf.sh
/etc/iperf.sh
```bash
firewall-cmd --zone=public --add-port=5001/tcp --permanent
firewall-cmd --zone=public --add-port=5002/tcp --permanent
firewall-cmd --zone=public --add-port=5003/tcp --permanent
firewall-cmd --zone=public --add-port=5004/tcp --permanent
firewall-cmd --zone=public --add-port=5005/tcp --permanent
firewall-cmd --zone=public --add-port=5006/tcp --permanent
firewall-cmd --zone=public --add-port=5007/tcp --permanent
firewall-cmd --zone=public --add-port=5008/tcp --permanent
firewall-cmd --zone=public --add-port=5009/tcp --permanent
firewall-cmd --zone=public --add-port=5010/tcp --permanent

systemctl restart firewalld

ps aux | grep iperf
#查看运行进程

yum install psmisc -y

killall -9 iperf
killall -9 iperf3
#kill进程

netstat -antup
#查看网络端口情况
iptraf-ng
#查看设备网络流量

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值