ina260-beaglebone-performance/scripts/network_host.sh
2025-04-01 17:56:32 +02:00

11 lines
346 B
Bash

#!/usr/bin/env bash
# Config
INTERNET_INTERFACE="wlp0s20f3"
BEAGLEBONE_INTERFACE="enp0s20f0u4u4u2"
# Setup
iptables -F
iptables -t nat -A POSTROUTING -o ${INTERNET_INTERFACE} -j MASQUERADE
iptables -A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i ${BEAGLEBONE_INTERFACE} -o ${INTERNET_INTERFACE} -j ACCEPT