Skip to content

Instantly share code, notes, and snippets.

@vallettea
Last active October 27, 2015 09:38
Show Gist options
  • Select an option

  • Save vallettea/3939e04128ac2cbe99e9 to your computer and use it in GitHub Desktop.

Select an option

Save vallettea/3939e04128ac2cbe99e9 to your computer and use it in GitHub Desktop.
Networking with the RPI

On mac os open preferences and Network pannel and then create a new interface Thunderboldt ethernet named RPI2. Set manually and 192.168.20.20 255.255.255.0 192.168.20.0

wlan + eth0

By default the Raspberry Pi disconnects the wlan0 of the wifi when we plug an ethernet cable. So we need to setup a static ip address on another network to make it work. Here is how. In /etc/network/interfaces:

auto lo
iface lo inet loopback

auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
        wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
        iface default inet dhcp

auto eth0
allow-hotplug eth0
iface eth0 inet static
        address  192.168.20.35
        netmask 255.255.255.0
        broadcast 192.168.20.255

Corresponding to the above picture. Also you need to remove a daemon that causes the automatic disconnection:

sudo apt-get remove ifplugd
sudo reboot

Note

To restart the wifi:

sudo ifdown wlan0
sudo ifup wlan0
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="networName"
psk="pwd"
proto=WPA
key_mgmt=WPA-PSK
pairwise=CCMP
auth_alg=OPEN
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment