Skip to content

Instantly share code, notes, and snippets.

@haxxinen
Last active October 17, 2023 12:56
Show Gist options
  • Save haxxinen/bf8d3e6301b220ac0be7578280f72661 to your computer and use it in GitHub Desktop.
Save haxxinen/bf8d3e6301b220ac0be7578280f72661 to your computer and use it in GitHub Desktop.
Mac + Pi on Ethernet
1. Share Internet from macOS to Pi Ethernet port
  • System Preferences -> Sharing -> (Unlock Pannel)
  • Share your connection from Wi-Fi (example)
  • To computers using: USB LAN / Ethernet
  • [check] Internet Sharing -> Start
2. Find bridged device using MAC address of Pi
$ iface=`ifconfig | grep -n3 '98:fc:84:ef:74:82' | grep -oE 'en[0-9]{2}' | sort -u`
$ net=`ifconfig | grep -n7 "member: $iface" | grep -oE 'inet ([0-9]{1,3}\.){3}' | sed 's/inet //g'`
$ pi_ip=`nmap -Pn -n $net"*" -p22 -oG - -T5 --open | grep 'tcp//ssh' | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}'`
$ ssh pi@$pi_ip
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment