Linux connection sharing

I am confused how this works. When i connect to the pwnagotchi i am using the USB ethernet connection. This is the only way, other than bluetooth, that i can connect to it. When i do so my wireless connection on my laptop drops. How do i share the internet connection with pwnagotchi.

Have you followed the Linux host instructions on the website?

I believe this issue is the reason for the existence of the script, the purpose should be to bridge the two connections together.

You can clone the pwnagotchi repo via git clone, plug in the pwnagotchi, and then go into the pwnagotchi/scripts folder and run the script on your host.

Thanks for this. It seems as though I have it working but I cannot ping from pwnagotchi while connected via SSH. I am using ubuntu and I now show 2 connections; one for wifi and one for the USB connection labelled enp0s20u3. This is the value I typed into the file. I must still be missing something. Thanks in advance for the help.

I fixed my own problem. I needed to update both connections in the .sh file. I am now pinging away.

Hi guys i am a total noob in programming and i am stuck.

  • Pwnagotchi runs via USB in manu mode
  • SSH runs between Host via USB to Pwnagotchi
  • Implementing doesnt work
    i get this error:

RTNETLINK answers: File exists

what i should change in this script?

#!/usr/bin/env bash

name of the ethernet gadget interface on the host


host interface to use for upstream connection


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

echo 1 > /proc/sys/net/ipv4/ip_forward

Thanks for everyone supporting this cool project!

Cheers! :smiley_cat:

After face palming myself, i found a solution her:

Forgot to put an DNS mask on it in “Networksettings” --> “” added and its works!

:checkered_flag: :man_shrugging:

1 Like