# Ad-Hoc Network + Raspberry Pi

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

An ad-hoc network can allow you to wirelessly communicate between multiple Raspberry Pis without the use of an external router.

## Step 1: Creating the Network

Ensure that the Pi can connect to WiFi. For the model 3+, this is built in. If your Pi is not a 3+, you will need a WiFi dongle.

Run the command

sudo iwconfig wlan0 mode ad-hoc channel 11 essid "mesh"

where "mesh" can be any name (it will be the name of the network).

You will now have to assign the Pi an IP address manually. To do this simply run

sudo ip addr add 192.168.1.34 dev wlan0

If you want this network to be created and/or joined on startup, simply add these commands to /etc/rc.local
Modify (after saving a copy) /etc/network/interfaces to make it look like this
iface eth0 inet static