This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
solutions-tsg-scripts/roles/tsg-env-tun-mode/templates/setup.j2
2021-04-13 09:42:11 +08:00

28 lines
1.3 KiB
Django/Jinja

#!/bin/bash
modprobe 8021q
vconfig add {{ nic_mgr.name }} 100
vconfig set_flag {{ nic_mgr.name }}.100 1 1
ifconfig {{ nic_mgr.name }}.100 192.168.100.1 netmask 255.255.255.0 up
{% if tsg_access_type == 0 %}
ethtool -K {{ packet_io.internal_interface }} tso off
ethtool -K {{ packet_io.internal_interface }} gso off
ethtool -K {{ packet_io.internal_interface }} gro off
ethtool -K {{ packet_io.external_interface }} tso off
ethtool -K {{ packet_io.external_interface }} gso off
ethtool -K {{ packet_io.external_interface }} gro off
{% elif tsg_access_type == 4 or tsg_access_type == 5 %}
echo 3 > /sys/class/net/{{ ATCA_data_incoming.ethname }}/device/sriov_numvfs
ip link set {{ ATCA_data_incoming.ethname }} vf 1 vlan 4095
ip link set {{ ATCA_data_incoming.ethname }} vf 2 vlan 4095
ip link set {{ ATCA_data_incoming.ethname }} vf 0 trust on
ip link set {{ ATCA_data_incoming.ethname }} vf 1 trust on
ip link set {{ ATCA_data_incoming.ethname }} vf 2 trust on
ip link set {{ ATCA_data_incoming.ethname }} vf 1 mac 00:0e:c6:d6:72:c1
ip link set {{ ATCA_data_incoming.ethname }} vf 2 mac fe:65:b7:03:50:bd
ip link set {{ ATCA_data_incoming.ethname }} vf 0 spoofchk off
ip link set {{ ATCA_data_incoming.vf0_name }} up
ip link set {{ ATCA_data_incoming.vf1_name }} up
ip link set {{ ATCA_data_incoming.vf2_name }} up
{% endif %}