Skip to content

Instantly share code, notes, and snippets.

@josephcsible
Last active July 19, 2022 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephcsible/a6790215aea7345d10c8e7d8d947de3d to your computer and use it in GitHub Desktop.
Save josephcsible/a6790215aea7345d10c8e7d8d947de3d to your computer and use it in GitHub Desktop.
Masquerade one Wi-Fi network to another from a Mac
  • Boot with a USB drive with an image from https://github.com/marcosfad/mbp-ubuntu
  • Hold Option at the chime and pick the last one
  • echo high > /sys/bus/pci/drivers/amdgpu/0000:??:??.?/power_dpm_force_performance_level
  • apt install /usr/src/iso-firmware.deb
  • modprobe -r brcmfmac
  • modprobe brcmfmac
  • systemctl restart network-manager
  • Add this to /etc/NetworkManager/NetworkManager.conf:
[device]
wifi.scan-rand-mac-address=no
  • Comment out all of /etc/NetworkManager/conf.d/wifi_backend.conf
  • sudo systemctl restart NetworkManager
  • Connect to Wi-Fi with the normal GUI
  • apt install hostapd
  • iw dev wlan0 interface add wlan1 type __ap
  • cat /usr/share/doc/hostapd/examples/hostapd.conf > /etc/hostapd/hostapd.conf
  • Edit that new file, setting interface=wlan1, ssid, wpa=2, wpa_passphrase, and wpa_key_mgmt=WPA-PSK
  • systemctl unmask hostapd
  • systemctl start hostapd
  • ifconfig wlan1 inet 10.0.0.1/8
  • sysctl -w net.ipv4.ip_forward=1
  • iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
  • systemd-inhibit cat
  • Connect from clients with a static IP of 10.0.0.2 and up, and using a public DNS server
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment