Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Raspberry Pi for Secret Agents - Second Edition

You're reading from   Raspberry Pi for Secret Agents - Second Edition Turn your Raspberry Pi into your very own secret agent toolbox with this set of exciting projects

Arrow left icon
Product type Paperback
Published in Jan 2015
Publisher
ISBN-13 9781784397906
Length 206 pages
Edition 2nd Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Stefan Sjogelid Stefan Sjogelid
Author Profile Icon Stefan Sjogelid
Stefan Sjogelid
Arrow right icon
View More author details
Toc

Table of Contents (7) Chapters Close

Preface 1. Getting Up to No Good FREE CHAPTER 2. Audio Antics 3. Webcam and Video Wizardry 4. Wi-Fi Pranks – Exploring Your Network 5. Taking Your Pi Off-road Index

Creating an ad hoc Wi-Fi network

Since there won't be a DHCP server to hand out IP addresses to our two network devices, what we want to do is assign static IP addresses on both Pi and laptop. We can pick any two addresses from the private IPv4 address space we saw in the Mapping out your network with Nmap section in Chapter 4, Wi-Fi Pranks – Exploring Your Network. In the following example, we'll use 192.168.10.1 for the Pi and 192.168.10.2 for the laptop:

  1. Type in the following command on the Pi to open up the network interfaces configuration:
    pi@raspberrypi ~ $ sudo nano /etc/network/interfaces
    
  2. Now find the line that says iface default inet dhcp and put a # character in front of the line to temporarily disable requesting an IP address from a DHCP server. Then add the following three lines beneath:
    iface default inet static
    address 192.168.10.1
    netmask 255.255.255.0
  3. Press Ctrl + X to exit and select y when prompted to save the modified buffer, then press the Enter key to confirm...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime