Jump to content

Mac OSX Internet Sharing with WiFi Pineapple howto


mram42

Recommended Posts

It frustrated me that out of the box the Pineapple and Mac OSX Internet Sharing don't work. Sometimes I just want to use my OSX machine with the pineapple. I searched online but couldn't find a solution. And the Mac OSX ICS page on the wiki is still very very empty.

So I looked into it and got it working. It isnt that hard. You can find the howto at http://champagneandsecurity.wordpress.com/2014/10/03/wifi-pineapple-and-mac-os-x-internet-sharing/

Hope it helps some of you Mac users out there.

Link to post
Share on other sites
  • Replies 67
  • Created
  • Last Reply

It frustrated me that out of the box the Pineapple and Mac OSX Internet Sharing don't work. Sometimes I just want to use my OSX machine with the pineapple. I searched online but couldn't find a solution. And the Mac OSX ICS page on the wiki is still very very empty.

So I looked into it and got it working. It isnt that hard. You can find the howto at http://champagneandsecurity.wordpress.com/2014/10/03/wifi-pineapple-and-mac-os-x-internet-sharing/

Hope it helps some of you Mac users out there.

Dude! You should add that to the wiki! Much better than my old how-to.

Link to post
Share on other sites

once you've 'clicked' trough enableing ICS on the proper interfaces this will do the rest:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist
#editing file /Library/Preferences/SystemConfiguration/com.apple.nat.plist
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkNumberStart 172.16.42.0
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist
sudo ifconfig bridge100 172.16.42.42 netmask 255.255.255.0 up”
cat /etc/bootpd.plist | sed "s/172.16.42.1/172.16.42.42/"|sed "s/172.16.42.2/172.16.42.43/" > /tmp/temp.bootpd.plist
sudo mv /tmp/temp.bootpd.plist /etc/bootpd.plist 
sudo kill -HUP `pgrep bootpd`
Link to post
Share on other sites

once you've 'clicked' trough enableing ICS on the proper interfaces this will do the rest:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist
#editing file /Library/Preferences/SystemConfiguration/com.apple.nat.plist
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkNumberStart 172.16.42.0
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.InternetSharing.plist
sudo ifconfig bridge100 172.16.42.42 netmask 255.255.255.0 up”
cat /etc/bootpd.plist | sed "s/172.16.42.1/172.16.42.42/"|sed "s/172.16.42.2/172.16.42.43/" > /tmp/temp.bootpd.plist
sudo mv /tmp/temp.bootpd.plist /etc/bootpd.plist 
sudo kill -HUP `pgrep bootpd`

On Yosemite, you'll need to set SharingNetworkNumberEnd and SharingNetworkMask as well.

#editing file /Library/Preferences/SystemConfiguration/com.apple.nat.plist

defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkNumberStart 172.16.42.0

defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkNumberEnd 172.16.42.254

defaults write /Library/Preferences/SystemConfiguration/com.apple.nat NAT -dict-add SharingNetworkMask 255.255.255.0

Link to post
Share on other sites

I don't think you know how OS X handles ICS.

The reason why people struggle with ICS is because Apple like to "Think Differently" by implementing ICS so its locked to the 192.168.2.X range, however the commands above using default is a workaround.

Link to post
Share on other sites
  • 4 weeks later...

I have tried following insctructions on: http://champagneandsecurity.wordpress.com/2014/10/03/wifi-pineapple-and-mac-os-x-internet-sharing/

Step 3 seems to work in my mac os yosemite terminal.

Step 5: I get an error: "ifconfig: interface bridge100 does not exist"

Any suggestions?

For step 6, can I do all the DHCP address altering in the mac GUI network settings? Or are there some great command lines I should know?

Thanks!

Link to post
Share on other sites

I have tried following insctructions on: http://champagneandsecurity.wordpress.com/2014/10/03/wifi-pineapple-and-mac-os-x-internet-sharing/

Step 3 seems to work in my mac os yosemite terminal.

Step 5: I get an error: "ifconfig: interface bridge100 does not exist"

Any suggestions?

For step 6, can I do all the DHCP address altering in the mac GUI network settings? Or are there some great command lines I should know?

Thanks!

What do you guys think about this fix by changing the Pineapple network config?

http://802dot11.postach.io/using-mac-os-x-ics-to-work-with-wifi-pineapple

I'm assuming that would mess up a lot of things on the Pineapple?

Link to post
Share on other sites

What do you guys think about this fix by changing the Pineapple network config?

http://802dot11.postach.io/using-mac-os-x-ics-to-work-with-wifi-pineapple

I'm assuming that would mess up a lot of things on the Pineapple?

That was my old fix. Don't do it. You'll break the pineapple. Had to break out the serial cable on my mkIV.

Link to post
Share on other sites
  • 1 month later...

Also, the sudo kill -HUP `pgrep bootpd` doesn't work - looking for a particular PID it seems

Sudo is your friend, also, use "ps -a | grep bootpd" to find the PID

Hmmm... any headway on this? I'm on Yosemite and I'm having some problems.

Notes: In Yosemite is com.apple.NetworkSharing.plist the new com.apple.InternetSharing.plist and is bridge0 the new label for the network bridge that was formerly bridge 100?

I substituted the bridge100 for the en0 interface on my macbook, using osx lion. I could write a revised set of instructions if someone wants me to

Link to post
Share on other sites

I have written a small script to do the ICS automagically. Tested on OS X 10.7.5 Lion. Let me know how it works on newer versions!

Edit: I've made a better script, it's on the wiki*, or can be downloaded directly from here.

Edit2: The script is working on my 10.7.5 machine, and I'm working with someone else on the forum who can test with a 10.10 machine, we're working towards greater compatibility, and easy-to-understand code if you wish to look at it and alter it in any way. Please let me know if you come up with any issues or suggestions, the most current version as of writing this is 1.3.2.

*Was going to remove from the wiki due to the incompleteness and incompatibility issues currently being worked through, but the wiki moved, and the link didn't follow with the move, so it is no longer available there.

Edit3: Fixed link Most recent version is 1.4.2

Link to post
Share on other sites

Hello everyone.

I noticed that the OSX ICS support was.. Lacking. Someone found and linked a pretty good tutorial on the wiki, which works fine for most people (Some on earlier OSes have to substitute bridge100 for en0) but it's a tedious process which is annoying. Tedious and annoying processes are what scripts are for! So, I set out designing a script which will enable ICS on OSX automagically. Be warned that I've not yet worked out all the kinks. The script is available on github, and I encourage you apple users to test it and give me your feedback. The code is commented fairly well, and pretty easy to follow.

Current version: 1.7(Beta)

Be sure to enable access for assistive devices(10.8 and lower)

System Preferences > Accessibility > Check "Enable access for assistive devices" at bottom of window

On newer machines(10.9 and up), add Terminal to the Accessibility section of the Privacy tab of the Security and Privacy settings instead

System Preferences > Security & Privacy > Select "Privacy" tab at top of window > Select "Accessibility" Tab at left side of window > Click the lock and log in to allow changes > Click the "+" sign below the table > Navigate to /Applications/Utilities/Terminal and select "Open" in the bottom, right hand corner

If you ran the script before adding it to assistive devices/allowing to control computer, OR you used a script version prior to 1.6, you must remove the /wpplist folder. This can be achieved with 1.6 by running with the -r or the -n options. -r will restore backed up configs, -n will simply generate new configs.

As always, please notify me of any bugs by either sending me a PM, or replying to this thread. Thanks and enjoy!

-TGYK

Edit:

UPDATED! After 5 months of nothing, I've made some small changes, bugfixes and such. The applescript is interactive! As always, please notify me of bugs, suggestions, or issues.

Enjoy!

-TGYK

Link to post
Share on other sites

Also,

Please take note that when reviewing the script it is advised to set the portion

#Backup old NAT files and bootpd
if [ -e /Library/Preferences/SystemConfiguration/com.apple.nat.plist ]; then
mv /Library/Preferences/SystemConfiguration/com.apple.nat.plist /plistbackups/
echo "Backed up old NAT file"
fi
if [ -e /Library/Preferences/SystemConfiguration/com.apple.nat.lockfile ]; then
mv /Library/Preferences/SystemConfiguration/com.apple.nat.lockfile /plistbackups/
echo "Backed up old NAT lock file"
fi
if [ -e /etc/bootpd.plist ]; then
mv /etc/bootpd.plist /plistbackups/
echo "Backed up old bootpd file"
fi
sleep 1

to replace with below

#Backup old NAT files and bootpd
if [ -e /Library/Preferences/SystemConfiguration/com.apple.nat.plist ]; then
cp /Library/Preferences/SystemConfiguration/com.apple.nat.plist /plistbackups/
echo "Backed up old NAT file"
fi
if [ -e /Library/Preferences/SystemConfiguration/com.apple.nat.lockfile ]; then
cp /Library/Preferences/SystemConfiguration/com.apple.nat.lockfile /plistbackups/
echo "Backed up old NAT lock file"
fi
if [ -e /etc/bootpd.plist ]; then
cp /etc/bootpd.plist /plistbackups/
echo "Backed up old bootpd file"
fi
sleep 1

That is if you prefer to have the files copied instead of being moved.

Link to post
Share on other sites

I have written a small script to do the ICS automagically. Tested on OS X 10.7.5 Lion. Let me know how it works on newer versions!

Edit: I've made a better script, it's on the wiki*, or can be downloaded directly from here.

Edit2: The script is working on my 10.7.5 machine, and I'm working with someone else on the forum who can test with a 10.10 machine, we're working towards greater compatibility, and easy-to-understand code if you wish to look at it and alter it in any way. Please let me know if you come up with any issues or suggestions, the most current version as of writing this is 1.3.2.

*Was going to remove from the wiki due to the incompleteness and incompatibility issues currently being worked through, but the wiki moved, and the link didn't follow with the move, so it is no longer available there.

I'd be very interested in seeing this. Pretty frustrating TBH. Thanks, Apple, for making this ridiculous.

Link to post
Share on other sites

Added ability to detect if settings are locked, and click the lock to prompt for credentials if they are, as well as added changelog to the file. Newest version is pushed to the site. 1.4.3

Link to post
Share on other sites

Hey TGYK,

thank you for your efforts in developing this script! I am running Yosemite and the script seems to have some problems here. When executing the script as root, I receive this log:

Killing ICS
225:412: execution error: System Events got an error: Can’t get window "Sharing" of process "System Preferences". (-1728)
Backed up old NAT file
Backed up old bootpd file
Restored from previous completed configs
234:421: execution error: System Events got an error: Can’t get window "Sharing" of process "System Preferences". (-1728)
ICS started
IP on bridge100 set to 172.16.42.42
Set DNS to Google public DNS
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Reloaded bootpd file for DHCP

Obviously, the script does not work for me. Are there any specific settings one would have to make on the pineapple itself apart from the script?

Best,

jogi

Link to post
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...