接有偿搭建如有需要进群联系群主
QQ群:113254209
使用本命令列出网卡id
lspci -k | grep -i ethernet
root@pve:~# lspci -k | grep -i ethernet
08:00.0 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
08:00.1 Ethernet controller: Intel Corporation 82576 Gigabit Network Connection (rev 01)
0a:00.0 Ethernet controller: Intel Corporation I211 Gigabit Network Connection (rev 03)
然后0000:08:00.0替换成自己的
比如0000:08:00.0
cat /sys/bus/pci/devices/0000:08:00.0/sriov_totalvfs
这里8 显示这个网口能开7个VF网口
这种就是不支持
开启网卡sriov代码
cd /etc/systemd/system
新建文件 wksriov.service
enp8s0f0修改成自己对应的网卡
[Unit]
Description=Script to enable SR-IOV on boot
[Service]
Type=simple
start SR-IOV
ExecStartPre=/usr/bin/bash -c '/usr/bin/echo 7 > /sys/class/net/enp8s0f0/device/sriov_numvfs'
set VF MAC
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set dev enp8s0f0 vf 0 mac 00:80:00:00:00:00'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set dev enp8s0f0 vf 1 mac 00:80:00:00:00:01'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set dev enp8s0f0 vf 2 mac 00:80:00:00:00:02'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set dev enp8s0f0 vf 3 mac 00:80:00:00:00:03'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set dev enp8s0f0 vf 4 mac 00:80:00:00:00:04'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set dev enp8s0f0 vf 5 mac 00:80:00:00:00:05'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set dev enp8s0f0 vf 6 mac 00:80:00:00:00:06'
set PF up
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set enp8s0f0 up'
set VF up
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set enp8s0f0v0 up'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set enp8s0f0v1 up'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set enp8s0f0v2 up'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set enp8s0f0v3 up'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set enp8s0f0v4 up'
ExecStartPre=/usr/bin/bash -c '/usr/bin/ip link set enp8s0f0v5 up'
ExecStart=/usr/bin/bash -c '/usr/bin/ip link set enp8s0f0v6 up'
Restart=on-failure
[Install]
WantedBy=multi-user.target
systemctl daemon-reload
systemctl enable wksriov.service
reboot
cd /home
新建文件 sr-iov-registermacaddr.sh
防止VF网络和主机网络不能互相访问
enp10s0修改成自己pve管理网口名字
11月1日更新
可以看到我这里是pve
如果你的不是pve那就把这两个pve都改成你节点的名称
CTCONFDIR=/etc/pve/nodes/pve/lxc
VMCONFDIR=/etc/pve/nodes/pve/qemu-server
就像这样
#!/usr/bin/bash
#
# vf_add_maddr.sh Version 1.1
# Script is based on kriss35
# Update by Rama: Added vmbridge macaddress itself, simplified, systemd-service(RestartOnFailure) Compatible and speeded up with a tmpfile(one readout).
# Usage: execute directly without arguments, make an systemd-service or add it to crontab to run every x Minutes.
#
CTCONFDIR=/etc/pve/nodes/pve/lxc
VMCONFDIR=/etc/pve/nodes/pve/qemu-server
IFBRIDGE=enp10s0
LBRIDGE=vmbr0
TMP_FILE=/tmp/vf_add_maddr.tmp
C_RED='\e[0;31m'
C_GREEN='\e[0;32m'
C_NC='\e[0m'
if [ ! -d $CTCONFDIR ] || [ ! -d $VMCONFDIR ]; then
echo -e "${C_RED}ERROR: Not mounted, self restart in 5s!${C_NC}"
exit 1
else
MAC_LIST_VMS=" $(cat ${VMCONFDIR}/*.conf | grep bridge | grep -Eo '([[:xdigit:]]{1,2}[:-]){5}[[:xdigit:]]{1,2}' | tr '[:upper:]' '[:lower:]') $(cat ${CTCONFDIR}/*.conf | grep hwaddr | grep -Eo '([[:xdigit:]]{1,2}[:-]){5}[[:xdigit:]]{1,2}' | tr '[:upper:]' '[:lower:]')"
MAC_ADD2LIST="$(cat /sys/class/net/$LBRIDGE/address)"
MAC_LIST="$MAC_LIST_VMS $MAC_ADD2LIST"
/usr/sbin/bridge fdb show | grep "${IFBRIDGE} self permanent" > $TMP_FILE
for mactoregister in ${MAC_LIST}; do
if ( grep -Fq $mactoregister $TMP_FILE ); then
echo -e "${C_GREEN}$mactoregister${C_NC} - Exists!"
else
/usr/sbin/bridge fdb add $mactoregister dev ${IFBRIDGE}
echo -e "${C_RED}$mactoregister${C_NC} - Added!"
fi
done
exit 0
fi
chmod +x sr-iov-registermacaddr.sh
./sr-iov-registermacaddr.sh
如果你VF网卡有直通给Ubuntu 那记得在控制台修改网卡名字
sudo -i
nano /etc/netplan/00-installer-config.yaml
群晖docker安装iperf 服务端命令 一次性
docker run -it –rm –name=iperf-srv –network=host clearlinux/iperf -s
apt-get install iperf3
iperf3 -c 192.168.3.191 -i1 -t60 -P8
- 最新
- 最热
只看作者