Hi all,
I've managed to get the Pi mostly set up without much help, but I'm struggling with what I gather is quite a simple thing, due to the lack of posts about it.
I want to share the wireless internet connection of my macbook through it's ethernet port to the Pi. I have enabled internet sharing in the macbook's settings and connected the ethernet cable between the two. No joy on the Pi end though. Am I missing something? I had a little google and some people are mentioning IP addresses, subnet masks and the like, but I'm not entirely sure where I have to go on the mac to change these things.
Thanks
-
- Posts: 3
- Joined: Sun May 27, 2012 8:03 pm
Re: Sharing internet connection through ethernet from Mac to
It might be the PI is expecting the MAC to provide Web access, where inf act its your router
I fixed a similar problem, look at my notes under "Raspberry PI on the move"
Problem in part was the /etc/resolv.conf file
Add this at the bottom of /etc/dhcp/dhclient.conf (where 192.168.0.1 is your router IP and reboot:
interface "eth0" {
prepend domain-name-servers 192.168.0.1;
}
Test with
$ ping www.google.com
from command line see if its resolved.
I fixed a similar problem, look at my notes under "Raspberry PI on the move"
Problem in part was the /etc/resolv.conf file
Add this at the bottom of /etc/dhcp/dhclient.conf (where 192.168.0.1 is your router IP and reboot:
interface "eth0" {
prepend domain-name-servers 192.168.0.1;
}
Test with
$ ping www.google.com
from command line see if its resolved.
-
- Posts: 64
- Joined: Wed Jun 13, 2012 6:06 am
Re: Sharing internet connection through ethernet from Mac to
Are you sure the mac isn't trying to share the wired connection through a wireless ad-hoc network. Generally, I've found that the default for Internet connection sharing is often to take a more reliable wired connection and share it. Check this on the mac before modifying config files on the pi as that line would add 192.168.0.1 on all ethernet connections on the pi. If the router gives a different dns then you'd be waiting 60 seconds or more for 192.168.0.1 to time out before a page loads... best to just modify /etc/resolv.conf directly if you need to.
echo 'nameserver 192.168.0.1' | sudo tee -a /etc/resolv.conf
would do the same thing as the modification to dhclient.conf without being permanent
echo 'nameserver 192.168.0.1' | sudo tee -a /etc/resolv.conf
would do the same thing as the modification to dhclient.conf without being permanent
Re: Sharing internet connection through ethernet from Mac to
Good point timothy,If the router gives a different dns then you'd be waiting 60 seconds or more for 192.168.0.1 to time out before a page loads... best to just modify /etc/resolv.conf directly if you need to.
I guess I should have said your DNS server
Problem I found was if you have a subnet with just your RaspPi The Rasp PI does not know what the DNS server is.
echo 'nameserver 192.168.0.1' | sudo tee -a /etc/resolv.conf
Above is just as bad as if there's a duff entry in resolv.conf possibly created by DHCP client you put the correct nameserver after the bad one and you still get delays.
If you change to static IP the resolv.conf may still have this wrong information.