Setting up a Ad-Hoc network

Ad-Hoc networks are useful when you just need a connection between a few machines with Wireless networking and no routers. It's an underused feature, but sometimes may be useful.

Setting up an Ad-Hoc network is pretty simple. In macOS, open the wireless panel in the menu bar and select "Create Network..."

Screenshot-2018-08-22-at-7.35.19-PM

After that, set your network name and choose any channel.

Screenshot-2018-08-22-at-7.37.06-PM

Your status bar should show this icon Screenshot-2018-08-22-at-7.43.14-PM and you'll be connected to your Ad-Hoc network.

Screenshot-2018-08-22-at-7.41.18-PM

Let's also configure it in Ubuntu 18.04 using netplan and iw.

/etc/netplan/20-adhoc.yaml:

network:
  version: 2
  renderer: networkd
  wifis:
    wlp5s0:
      access-points:
        "Ubuntu Machine":
          mode: adhoc
          password: password123

Using the iw command:

iw interface set type ibss
ip link set interface up
iw interface ibss join "Ubuntu Machine" 2442

In Windows 10, the command prompt has to be used to run the following commands:

netsh wlan set hostednetwork mode=allow ssid=Ahhh key=password123
netsh wlan start hostednetwork

From here on, you can connect other devices to the network the typical way.