Raspberry Pi: Difference between revisions

From miki
Jump to navigation Jump to search
Line 13: Line 13:
</source>
</source>
where <code>192.168.1.*</code> will be your local network mask.
where <code>192.168.1.*</code> will be your local network mask.

;Raspberry in BRIDGE mode
:Methods above fail if Raspberry is setup to bridge wlan0-eth0 connections. In that case, the visible MAC address is the one of the wlan0 interface. It can be detected because the address will be reported twice:
<source lang=bash>
sudo nmap -sP 172.19.2.0/23|sort|uniq -d
# Host is up (0.18s latency).
# MAC Address: 00:0F:13:05:46:C2 (Nisca) <-- MAC address of the Pi in bridge mode
# MAC Address: 80:86:F2:99:56:B5 (Intel Corporate)
</source>
:Now we can repeat the request above to get the IP address:
<source lang=bash>
sudo nmap -sP 172.19.2.0/23 | awk '/^Nmap/{ip=$NF}/00:0F:13/{print ip}'
</source>


=== Setup Pi as WiFi HotSpot (router) ===
=== Setup Pi as WiFi HotSpot (router) ===

Revision as of 20:24, 27 April 2015

Network

Detect all Raspberry Pi on local network

From [1].

sudo nmap -sP 192.168.1.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}'

where 192.168.1.* will be your local network mask.

We can also simply look for string Raspberry since nmap correctly identifies pi mac address:

sudo nmap -sP 192.168.1.0/24 | grep -B2 Raspberry

where 192.168.1.* will be your local network mask.

Raspberry in BRIDGE mode
Methods above fail if Raspberry is setup to bridge wlan0-eth0 connections. In that case, the visible MAC address is the one of the wlan0 interface. It can be detected because the address will be reported twice:
sudo nmap -sP 172.19.2.0/23|sort|uniq -d
# Host is up (0.18s latency).
# MAC Address: 00:0F:13:05:46:C2 (Nisca)              <-- MAC address of the Pi in bridge mode
# MAC Address: 80:86:F2:99:56:B5 (Intel Corporate)
Now we can repeat the request above to get the IP address:
sudo nmap -sP 172.19.2.0/23 | awk '/^Nmap/{ip=$NF}/00:0F:13/{print ip}'

Setup Pi as WiFi HotSpot (router)

This setup the Pi has a WiFi access point (AP) in router mode (NAT).

References:

Setup Pi as WiFi HotSpot (bridge)

References:

Troubleshoot

403 Forbidden when apt-get upgrade

From [2]:

Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main libc-dev-bin armhf 2.13-38+rpi2+deb7u8           
  403  Forbidden
Err http://mirrordirector.raspbian.org/raspbian/ wheezy/main libc6-dev armhf 2.13-38+rpi2+deb7u8              
  403  Forbidden

Edit /etc/apt/apt.conf:

-deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
+#deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
+deb http://archive.raspbian.org/raspbian wheezy main contrib non-free
+deb-src http://archive.raspbian.org/raspbian wheezy main contrib non-free