Open Niubbo75 opened 3 years ago
The connection sharing script has to be executed on the device from which you want to share the connection, not on the Pwnagotchi/RaspberryPi. So in your situation you'll have to execute it on your Mac.
Hello, sorry for the delay in my reply, but I have try it only now. I've run the script on my Mac (now upgraded to Big Sur), I had run it with sudo but I can't share connection anymore, plus, when I connect also my Pi, I can't surf the net (ping google.com or 8.8.8.8 gave only unreacheable destinations both from Pi and Mac). Should I have to change something in the script?
I am struggling with the same issue, any update OP ?
Same issue here. I'm figuring why.
Here is excerpt of ifconfig
on my Macbook.
I have both Wi-Fi, ethernet and usb with pi zero w connected on my Macbook.
The interface of usb (en14) has been manual setted at 10.0.0.1 by me.
$ ifconfig
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=400<CHANNEL_IO>
ether xx:xx:xx:xx:xx:xx
inet6 xxxx::xxx:xxxx:xxxx:xxxx%en0 prefixlen 64 secured scopeid 0x6
inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx prefixlen 64 autoconf secured
inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx prefixlen 64 autoconf temporary
inet 192.168.100.201 netmask 0xffffff00 broadcast 192.168.100.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect
status: active
en7: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=6407<RXCSUM,TXCSUM,VLAN_MTU,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
ether xx:xx:xx:xx:xx:xx
inet6 xxxx::xxx:xxxx:xxxx:xxxx%en7 prefixlen 64 secured scopeid 0x15
inet6 xxxx:xxxx:xxxx:xxxx:xxx:xxxx:xxxx:xxxx prefixlen 64 autoconf secured
inet6 xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx prefixlen 64 autoconf temporary
inet 192.168.100.102 netmask 0xffffff00 broadcast 192.168.100.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (1000baseT <full-duplex>)
status: active
en14: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=6407<RXCSUM,TXCSUM,VLAN_MTU,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
ether xx:xx:xx:xx:xx:xx
inet6 xxxx::xxxx:xxxx:xxxx:xxxx%en14 prefixlen 64 secured scopeid 0x17
inet 10.0.0.1 netmask 0xffff0000 broadcast 10.0.255.255
nd6 options=201<PERFORMNUD,DAD>
media: autoselect (100baseTX <full-duplex>)
status: active
Then here is result of macos_connection_share.sh
on my Macbook.
$sudo ./macos_connection_share.sh
Password:
sharing connecting from upstream interface en0 to usb interface en14 ...
net.inet.ip.forwarding: 1 -> 1
No ALTQ support in kernel
ALTQ related functions disabled
pfctl: pf already enabled
pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.
No ALTQ support in kernel
ALTQ related functions disabled
Then testing is no work on Pi via ssh through usb.
pi@pwnagotchi:/ $ ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
--- 8.8.8.8 ping statistics ---
9 packets transmitted, 0 received, 100% packet loss, time 347ms
I don't know how helpful this will be, but 1. this issue seems to go back to the first Pwnagotchi release - lots of reddit posts about getting connection sharing to work on a mac.
You could look into going into system prefs > sharing and turning on internet sharing to see if that changes anything. (I actually think you need to for bluetooth? That's a separate issue).
Googling No ALTQ support in kernel
brings up some StackExchange posts regarding PFSense throwing this issue. One suggestion says to go into System Prefs > Security & Privacy > Firewall and turning the firewall on. I haven't tried this yet, however, so ymmv.
A slightly separate solution I saw for the linux_connection_share.sh
was to declare the interfaces you want share. For instance, sudo ./linux_connection_share.sh [Pwnagotchi Interface Name] [Upstream Interface Name]
Eg. sudo ./linux_connection_share.sh enp0s20f0u2 wlo1
That suggestion was from this post..
If you have any linux machines available, I have had very a very steady working Pwnagotchi when setup, configured, and connected to kali linux. But every time I try to on my mac, I'm met with issues. I would love to see if someone has a succinct solution for this that works for everyone.
I'm also having trouble getting the Pi 0 connected to the internet via MacBook. If I configure Bluetooth I can get it to use my phone data, but I'd like to use my laptop on Wi-Fi so I can install a version of Numpy that allows the AI to work, as well as fix the expired apt
signing key.
It's also worth noting that I was able to share internet using a Raspberry Pi 3B without issue via an ethernet cable.
Here's what I've tried so far:
10.0.0.1
255.255.255.0
10.0.0.1
Run sudo ./macos_connection_sharing.sh en0 en7
sudo ./macos_connection_share.sh en0 en7
Password:
sharing connecting from upstream interface en0 to usb interface en7 ...
net.inet.ip.forwarding: 0 -> 1
No ALTQ support in kernel
ALTQ related functions disabled
pfctl: pf already enabled
pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.
No ALTQ support in kernel
ALTQ related functions disabled
10.0.0.1
255.255.255.0
10.0.0.1
System Preferences > Network > RNDIS/Ethernet Gadget > Details
10.0.0.1
255.255.255.0
10.0.0.1
sudo ./macos_connection_sharing.sh en0 en7
sudo ./macos_connection_share.sh en0 en7
Password:
sharing connecting from upstream interface en0 to usb interface en7 ...
net.inet.ip.forwarding: 0 -> 1
No ALTQ support in kernel
ALTQ related functions disabled
pfctl: pf already enabled
pfctl: Use of -f option, could result in flushing of rules
present in the main ruleset added by the system at startup.
See /etc/pf.conf for further details.
No ALTQ support in kernel ALTQ related functions disabled
10.0.0.1
255.255.255.0
10.0.0.1
Ha, of course after I finally write out the post I figure it out.
10.0.0.1
255.255.255.0
10.0.0.1
sudo ./macOS_connection_share.sh en0 en7
NB:
ifconfig
. en0 is likely always correct but en7 will be highly user-dependent (it is en11 in my case). To find this, look for the 10.0.0.1 IP address assigned to the interface.sudo sysctl -w net.inet.ip.forwarding=0
(You could skip this but in the interest of completeness it's here)sudo pfctl -d
(This disables packet filtering and re-enables Privacy Relay)So I did everything you said @rinchen in your post and it seems you'll get the error No ALTQ support in kernel ALTQ related functions disabled
regardless. I did notice that net.inet.ip.forwarding: 1 -> 1
changed from 0 -> 1 and it does work now. I haven't checked if it still works after a reboot though, but thanks for your solution
I've create a folder in /home/pi named scripts, there I've put macos_connection_share.sh I've made it executable running chmod a+x macos_connection_share.sh Next I've run the script, both from pi user and root but I got the same issue:
pi@pwnagotchi:~/scipts $ ./macos_connection_share.sh
ifconfig: option ``-lu' not recognised.
ifconfig: ``--help' gives usage information.
can't find usb interface with ip 10.0.0.1
pi@pwnagochi:~/scipts $ sudo ./macos_connection_share.sh
ifconfig: option ``-lu' not recognised.
ifconfig: ``--help' gives usage information.
can't find usb interface with ip 10.0.0.1
What can I do to fix it?
Steps to Reproduce (for bugs)
Your Environment
[ ] Latest pwnagochi image downloaded from official repository
[ ] Raspberry Pi0 W
[ ] MacOX 10.15.7