#!/bin/bash -xe # Interface towards UPF: IFACE_UPF="enp2s0f0np0" NUM_ENB=50 # Disable ethernet flow control: sudo ethtool -A $IFACE_UPF autoneg off rx off tx off # Increase NIC buffers: sudo ethtool -G $IFACE_UPF rx 8192 tx 8192 # Increase Adapter Transmit Queue: sudo ip link set dev $IFACE_UPF txqueuelen 2000 # Increase UDP buffer memory: sudo sysctl -w net.ipv4.udp_mem="763563 900000000 1000000000" sudo sysctl -w net.core.optmem_max=16000000 sudo sysctl -w net.core.rmem_max=2000000000 sudo sysctl -w net.core.rmem_default=2000000000 sudo sysctl -w net.core.wmem_max=2000000000 sudo sysctl -w net.core.wmem_default=2000000000 sudo sysctl -w net.core.netdev_max_backlog=2000 sudo sysctl -w net.core.netdev_budget=600 # Set up IP addresses: for i in $(seq "0" "$((NUM_ENB - 1))"); do sudo ip addr add "$(printf "172.16.31.1%02u/24" $i)" dev $IFACE_UPF || true; done