Share your Mac's internet connection with a WiFi Pineapple MK7 on its default 172.16.42.0/24 subnet, and route all of that traffic through your VPN.
macOS Internet Connection Sharing (ICS) doesn't cooperate with the Pineapple out of the box:
- It only shares on the
192.168.2.0/24subnet, and the GUI won't let you change that. - It assigns addresses over DHCP, which conflicts with the MK7's default static IP.
- It expects a different layout than the Pineapple's
172.16.42.1/24interface.
VPNs make it worse. macOS won't route shared traffic through the tunnel on its own, and it has no built-in way to NAT traffic from a USB interface out through a VPN. Pineapple traffic ends up leaking straight out your normal uplink.
If you're running the Pineapple on a red team or wireless assessment and need everything tunneled, that's a real problem.
Run it and it will:
- Find the Pineapple interface by its MAC prefix (
00:13:37). - Set your Mac to
172.16.42.42on that interface. - Enable IP forwarding.
- Find your default outbound interface, usually the VPN tunnel (
utun0,ipsec0, and so on). - Write
pfctlNAT rules so the Pineapple's subnet routes out through that interface. - Give you a menu to start and stop ICS.
- Refuse to run over a non-tunnel uplink unless you confirm the override prompt.
The Pineapple stays on its stock network the whole time, so you never touch the ICS GUI or run your own DHCP server. Client traffic won't go anywhere but the tunnel unless you say so.
chmod +x wp7_macos.sh
sudo ./wp7_macos.sh
The menu lets you start ICS, stop and undo everything, or quit.
- Wireless red teaming or penetration tests.
- Running the MK7 as a rogue AP or MITM relay.
- Any time you want clean setup and teardown without rebooting or hand-editing config.
- macOS machines that have to route through a VPN.
- macOS (tested on Monterey, Ventura, Sonoma, and Sequoia).
- A WiFi Pineapple MK7 on its default config.
- Admin/root privileges.
- Optional: any VPN that creates a tunnel interface (
utunX,ipsecX).
Run the script and choose [X] Stop / Undo ICS. That disables IP forwarding, removes the static IP from the Pineapple interface, flushes and disables pfctl, and deletes /etc/pf.anchors/com.pineapple.nat.
