27 lines
738 B
Django/Jinja
27 lines
738 B
Django/Jinja
#!/bin/bash
|
|
|
|
INF="$1"
|
|
STA="$2"
|
|
|
|
logger "$0 called for interface named $INF with $STA ..."
|
|
|
|
if [ "$INF" == "enp1s0" ]
|
|
then
|
|
logger "$0: Interface $INF with $STA ,Set $INF VF And Vlan ..."
|
|
modprobe 8021q
|
|
echo 3 > /sys/class/net/enp1s0/device/sriov_numvfs
|
|
sleep 0.5
|
|
echo add 0,3813,3814 > /sys/class/net/enp1s0/device/sriov/0/trunk
|
|
ip link set enp1s0 vf 1 vlan 3813
|
|
ip link set enp1s0 vf 2 vlan 3814
|
|
ip link set enp1s0 vf 0 trust on
|
|
ip link set enp1s0 vf 1 trust on
|
|
ip link set enp1s0 vf 2 trust on
|
|
ip link set enp1s0 vf 0 spoofchk off
|
|
ip link set enp1s0 vf 0 mac 00:0e:c6:d6:72:c1
|
|
ip link set enp1s0 vf 1 mac fe:65:b7:03:50:bd
|
|
sleep 1
|
|
ip link set enp1s2 up
|
|
ip link set enp1s2f1 up
|
|
ip link set enp1s2f2 up
|
|
fi |