mirror of
https://github.com/jayofelony/pwnagotchi.git
synced 2025-07-01 18:37:27 -04:00
Update everyting!
Signed-off-by: jayofelony <oudshoorn.jeroen@gmail.com>
This commit is contained in:
19
scripts/linux_connection_share.sh
Executable file
19
scripts/linux_connection_share.sh
Executable file
@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
|
||||
# name of the ethernet gadget interface on the host
|
||||
USB_IFACE=${1:-enp0s20f0u1}
|
||||
USB_IFACE_IP=10.0.0.1
|
||||
USB_IFACE_NET=10.0.0.0/24
|
||||
# host interface to use for upstream connection
|
||||
UPSTREAM_IFACE=${2:-enxe4b97aa99867}
|
||||
|
||||
ip addr add "$USB_IFACE_IP/24" dev "$USB_IFACE"
|
||||
ip link set "$USB_IFACE" up
|
||||
|
||||
iptables -A FORWARD -o "$UPSTREAM_IFACE" -i "$USB_IFACE" -s "$USB_IFACE_NET" -m conntrack --ctstate NEW -j ACCEPT
|
||||
iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
||||
iptables -t nat -F POSTROUTING
|
||||
iptables -t nat -A POSTROUTING -o "$UPSTREAM_IFACE" -j MASQUERADE
|
||||
|
||||
echo 1 > /proc/sys/net/ipv4/ip_forward
|
Reference in New Issue
Block a user