#!/bin/bash -xe # Interface towards UPF: IFACE_RAN="enp2s0f0np0" IFACE_CN="enp2s0f1np1" # Disable ethernet flow control: sudo ethtool -A $IFACE_RAN autoneg off rx off tx off sudo ethtool -A $IFACE_CN autoneg off rx off tx off # Increase NIC buffers: sudo ethtool -G $IFACE_RAN rx 8192 tx 8192 sudo ethtool -G $IFACE_CN rx 8192 tx 8192 # Enable IP forwarding: sudo sysctl -w net.ipv4.ip_forward=1 # 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 UPF address: sudo ip addr add 172.16.31.2/24 dev $IFACE_RAN || true; sudo ip addr add 172.16.32.1/24 dev $IFACE_CN || true;