aboutsummaryrefslogtreecommitdiff
path: root/scripts/network_host.sh
diff options
context:
space:
mode:
authorLoïc Guégan <manzerbredes@mailbox.org>2025-04-01 17:56:32 +0200
committerLoïc Guégan <manzerbredes@mailbox.org>2025-04-01 17:56:32 +0200
commit2f1837a75e96612040c6db2b594adf7463173c88 (patch)
tree99f667df480606457c0786e3c314caba07f91038 /scripts/network_host.sh
Cleaning repositoryHEADmaster
Diffstat (limited to 'scripts/network_host.sh')
-rw-r--r--scripts/network_host.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/scripts/network_host.sh b/scripts/network_host.sh
new file mode 100644
index 0000000..d48b90b
--- /dev/null
+++ b/scripts/network_host.sh
@@ -0,0 +1,11 @@
+#!/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