Jump to content

Mac OSX Internet Sharing with WiFi Pineapple howto


mram42
 Share

Recommended Posts

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

Edit: derp

I'll have to figure out if the sharing prefpane window is named differently. The kill command error should be fixed for the next version. If you want to work with me and do some testing for me that'd be awesome, send me a PM if you're interested.

Edited by TGYK
Link to comment
Share on other sites

  • Replies 67
  • Created
  • Last Reply

Top Posters In This Topic

Found a lot of great info in this thread and was able to get ICS running in Yosemite just by modifying a couple lines in a script mentioned above. Just took some poking around and a little bit of guess work to find the answer.

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.NetworkSharing.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.NetworkSharing.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'

com.apple.InternetSharing.plist was changed to com.apple.NetworkSharing.plist

Link to comment
Share on other sites

Hey Red5,

thank you for posting your fix! Unfortunately, the last line returns an "illegal process id" error and ICS still does not work afterwards. Could you post the contents of your networksharing and apple.nat files?

Can you explain what this line (especially the "sed") does?

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

Thanks a lot!

Link to comment
Share on other sites

I found this script in this thread. that error comes from the original, i only changed some file links.

The sed commands parses through data streams. in this case the cat would generate a stream and pipe output into the input of the first sed looking for the default values and changing them the the values needed for Mark V ICS again piping into another sed command to modify the secondary and tunneling that output to overwrite (or create new if non existant) our temp.bootpd.plist

com.apple.NetworkSharing.plist is unmodified only need to be turned off before changing settings and turned back on again to put them into effect

in the script it seems in the original post the .plist was left out of the command. and i had modified mine by hand before using the script, while still figuring things out. try this:

sudo launchctl unload -w /System/Library/LaunchDaemons/com.apple.NetworkSharing.plist
sudo defaults write /Library/Preferences/SystemConfiguration/com.apple.nat.plist NAT -dict-add SharingNetworkNumberStart 172.16.42.0
sudo launchctl load -w /System/Library/LaunchDaemons/com.apple.NetworkSharing.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 

Link to comment
Share on other sites

Alright, I've figured out the issues with support on 10.10 Yosemite. The biggest issue is the change to accessibility.

You need to enable scripts to be able to 'control your computer' or in other words, allow the applescript portions of my script to run properly.

To do this, go to System Preferences, click "Security and Privacy".

Click the lock and authenticate changes.

Select the "Accessibility" tab

Click the "+" sign below the table

Browse to Applications > Utilities > Terminal and click "Open" in the bottom, right hand corner.

Now run the script using the terminal:

sudo chmod +x ~/Downloads/scriptname
sudo ~/Downloads/scriptname

***IMPORTANT***

Use version 1.4.4 for Yosemite, as it has a couple of fixes to ensure it works.

If you ran the script before adding terminal to the accessebility settings, you need to remove the /wpplist folder.

sudo rm -rf /wpplist

Thanks for the support, please report any errors or bugs, and I'll work with you to resolve them. If you think you have a better way of doing something in the script, speak up! I'd love to hear your ideas and work with you to implement them. Thanks!

-TGYK

edit: (THE KILL COMMAND IS NOT WORKING, WORKING ON A FIX NOW)

edit: It appears I'm not getting bootpd started, it might detect the dhcp server already on the network and be trying to use that.

edit: appears that the InternetSharing process has changed as well, so the "Killing ICS" section of the script does not work.. I have some work to do. Taking 1.4.4 offline for the time being

Edited by TGYK
Link to comment
Share on other sites

Pushed beta for yosemite 10.10.1 support. Version 1.5 is live. Please follow the instructions in my previous post, and if you experience issues, please remove the /wpplist and /plistbackups folders, and the /etc/bootpd.plist and /Library/Preferences/SystemConfiguration/com.apple.nat.plist files, restart, then toggle sharing on and off manually in the sharing preferences, then attempt the script again. If you're still experiencing issues, please show any errors here. Thanks!

-TGYK

Link to comment
Share on other sites

Keeping you guys in the loop, the few who might actually use this. I am adding functionality to allow for configurable options like DNS, Gateway, and more. Also slated for 1.6 is more robust, dynamic applescript.

Debating if I should do something that collects info on the available devices to share from, and the devices to share to, and asking user on generating new configs in an applescript dialogue "Map from [select interface] to [select interface]" but am still on the fence about the implications it'd take to implement this. Could use some feedback!

Also debating setting up a github for this project so it's not all hosted on my home web server, still need to get better versed in using it though.

Link to comment
Share on other sites

Does it work with Yosemite because I can't downgrade to Mavericks because I have a 2014 MacBook pro and it came with it

It should, I've been working hard trying to ensure compatibility, if you have any issues with the script, go ahead and PM me or reply to the thread. Don't forget to follow the instructions in the README on Github.

Link to comment
Share on other sites

Hi TGYK, thanks a lot for working on this, learning a lot with your script. I can't figure out why not working on my 10.9.4 maverick macbook. Getting the following error echos from terminal, guess its mainly the click it does;t understand how to do. Let me know if you have any ideas. Thanks.

754:807: execution error: System Events got an error: every pop up button of group 1 of window "Sharing" of process "System Preferences" doesn’t understand the “click” message. (-1708)
NAT file created
NAT file edited
763:816: execution error: System Events got an error: every pop up button of group 1 of window "Sharing" of process "System Preferences" doesn’t understand the “click” message. (-1708)
ICS started
IP on en0 set to 172.16.42.42
Set Primary DNS to 8.8.8.8 Alternate to 8.8.4.4
File Doesn't Exist, Will Create: /etc/bootpd.plist
Set: Entry, ":Subnets:0:dhcp_domain_name_server:0", Does Not Exist
Set: Entry, ":Subnets:0:dhcp_router", Does Not Exist
Set: Entry, ":Subnets:0:net_range:0", Does Not Exist
Rewritten bootpd file for DHCP
Made backup directory for completed config files
Copied completed config files
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Reloaded bootpd file for DHCP

--edgecontrol

Link to comment
Share on other sites

Hi TGYK, thanks a lot for working on this, learning a lot with your script. I can't figure out why not working on my 10.9.4 maverick macbook. Getting the following error echos from terminal, guess its mainly the click it does;t understand how to do. Let me know if you have any ideas. Thanks.

754:807: execution error: System Events got an error: every pop up button of group 1 of window "Sharing" of process "System Preferences" doesn’t understand the “click” message. (-1708)
NAT file created
NAT file edited
763:816: execution error: System Events got an error: every pop up button of group 1 of window "Sharing" of process "System Preferences" doesn’t understand the “click” message. (-1708)
ICS started
IP on en0 set to 172.16.42.42
Set Primary DNS to 8.8.8.8 Alternate to 8.8.4.4
File Doesn't Exist, Will Create: /etc/bootpd.plist
Set: Entry, ":Subnets:0:dhcp_domain_name_server:0", Does Not Exist
Set: Entry, ":Subnets:0:dhcp_router", Does Not Exist
Set: Entry, ":Subnets:0:net_range:0", Does Not Exist
Rewritten bootpd file for DHCP
Made backup directory for completed config files
Copied completed config files
kill: usage: kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
Reloaded bootpd file for DHCP

--edgecontrol

Just to check, you do have accessibility for assistive devices enabled, right?

Assuming that it is, this is really odd. I know what the "Set:" messages are about, they generally pop up if the plist is 10.9+ and default, though with Maverics, it may be that the plist is different entirely. It may be worth me getting a copy and loading it onto my computer.

Just for further development purposes, can you run the script with the -v option so I can get the version string for your mac OS X? I need to use it to disable the kill commands for the bootpd process, as it seems to not run on 10.9+

Thanks!

Link to comment
Share on other sites

Hi,

I'm trying to set up my Mac to share the wifi connection to the Mark V. To do this i followed the guide on the wiki The difficulty starts from step 5:

5. Manually change the IP address used by the Mac's LAN interface with the command: ifconfig bridge100 172.16.42.42 netmask 255.255.255.0 up.

Here i get the message that bridge100 is not existing: "ifconfig: interface bridge100 does not exist"

6. Now we need to change some DHCP options, because by default the DHCP server tells the clients to use gateway 172.16.42.1. We do this by altering file /etc/bootpd.plist. There are two mentions of 172.16.42.1 that we need to change into 172.16.42.42. We also need to adjust the pool range. Look for the <key>net_range</key> section. Alter the starting address to 172.16.42.43.

In my booted.plist i can't find any mention of 172.16.42.1, this is what i can find in the file:

<dict>
	<key>bootp_enabled</key>
	<false/>
	<key>detect_other_dhcp_server</key>
	<false/>
	<key>dhcp_enabled</key>
	<false/>
	<key>dhcp_ignore_client_identifier</key>
	<true/>
	<key>use_server_config_for_dhcp_options</key>
	<false/>
</dict>

7. Find the PID of the bootpd process and give it a kill -HUP to reread its config file.

have not gotten this far yet..

I can connect to the web GUI of the pineapple.

I can even connect to the pineapple from an other device (phone) and acces the internet!

But in the webGUI i can't look for upgrades and i can't acces the pineapple bar, there i get the message to check the internet connection.

The pineapple has the firmware version 2.0.5

My Mac runs on OSX Yosemite, version 10.10.2

Any help would be much appreciated!

many thanks,

TheB

Link to comment
Share on other sites

  • 3 weeks later...

So has anyone gotten this to work on Yosemite? I'm not having success.

I've gotten it to work first time.

Today I tried it again and wasn't able to get it working properly but running the script again with the -n flag seems to have it working for me again.

I wouldn't imagine this should have to be run everytime I want to log in.... Or should it???

Link to comment
Share on other sites

Bellow are the various ways I have tried to connect my pineapple to the internet. The only method that has worked thus far is using wlan1 in "Client Mode", the problem with this solution is that I am unable to get PineAP running at the same time.

1) following

tutorial -> Doesn't work

2) following https://champagneandsecurity.wordpress.com/2014/10/03/wifi-pineapple-and-mac-os-x-internet-sharing/ -> at step 5, Error bridge100 doesn't exist

3) not sure how to complete http://802dot11.postach.io/post/using-mac-os-x-ics-to-work-with-wifi-pineapple

I also tried setting the pineapples wired connection to "Client Mode" and plugging it directly into a router, which didn't work.

Any Ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    No registered users viewing this page.


×
×
  • Create New...