This article shows how to share the Internet connection on your Mac with Raspberry Pi. The Pi is connected to Mac using an Ethernet cable. It also shows how to get the IP address of the Pi once the connection is established.
Sharing internet connection with Raspberry Pi
Connect your Raspberry Pi to the Mac using an Ethernet cable. The Raspberry Pi will automatically acquire an IP address.
To find out the Pi’s IP address type ifconfig in the Terminal and look for bridge interface. Usually it will be bridge0
and the interface will have an IP address of 192.168.2.1
Bridge interface is a special, emulated network interface used for sharing Internet connection. If you switch off the Internet Sharing the bridge interface will disappear.
To figure out IP address of the Pi you can use the nmap utility. In my example the Pi’s IP address belongs to 192.168.2.0/24
network. This is the same network where the bridge interface is.
nmap 192.168.2.0/24
The last screenshot shows the output of the nmap command. Only one host is up on this network (this does not count the bridge interface). Obviously, since it is a point to point Ethernet one cable connection this host must be Pi. It’s IP address is 192.168.2.3/24
.
The post Sharing Internet connection with Raspberry Pi. appeared first on stunning co.de.