0

We're going on a trip, and I want to set up a car only lan so that the kids can play games together on their tablets or maybe access a media shared volume.

There won't be any internet access.

Is this something I can do with just a pi, or do I need to get a travel router like a TP Link N300 to make it work?

AndyD273
  • 105
  • 6
  • 1
    There are 210 questions tagged access-point. Have you tried? – Milliways Jul 15 '22 at 02:49
  • @Milliways Yes. Do you feel mine is a duplicate? Might be I overlooked one that was close to what I am trying to figure out, or possibly I don't know enough to be asking the right question. Your comment doesn't solve either of those problems. – AndyD273 Jul 15 '22 at 04:41
  • I was trying to suggest possible solutions - there are many linked Answers. I have used some in the past. There are 2 main approached hostapd and systemd and a Raspberry Pi Ltd. tutorial - pick 1 and try it! – Milliways Jul 15 '22 at 05:05

1 Answers1

0

This tutorial describes how to setup a stand alone Access Point using systemd-networkd.

Configuring networking using systemd-networkd requires multiple steps, and it is easy to get things wrong.
The following scripts simplify the process and enables swapping between Access Point and normal networking.
There are other tutorials which offer additional features and/or automatic detection but at the expense of additional complexity.

Before running the scripts below follow the Simplified Systemd-Networkd setup and verify that networking is working as before.

I have changed most of my Pi to Systemd-Networkd and this offers similar functionality to the dhcpcd setup (except this will disable the Networking tool on the Desktop Panel).

  • Step1 installs necessary files.
  • The second script activates the Access Point.

Reboot REQUIRED!
All script MUST be run by root or with sudo.

This should result in an Access Point RaspberryPiNet @ address 10.1.4.1
If you have Ethernet this should continue to operate as before except static IP Addresses will require different settings.

SetupAccessPoint.sh

#! /bin/sh
# Script to install files for stand alone Access Point using systemd-networkd
# NOTE this does NOT swap networking systems - see separate script to activate
# This script MUST be run by root or with sudo
# 2022-07-20

echo "Install files for stand alone Access Point using systemd-networkd" echo "Before use change country & psk" echo "This setup for Frequency:2.412 GHz (Channel 1)"

if [ whoami != root ]; then echo "This script MUST be run by root or with sudo" exit fi

Setup wpa_supplicant as Access Point

cat > /etc/wpa_supplicant/wpa_supplicant-wlan0.conf <<EOF country=AU ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1

network={ ssid="RaspberryPiNet" mode=2 frequency=2412 key_mgmt=WPA-PSK proto=RSN WPA psk="PASSWORD" } EOF

Create a network configuration for Access Point

cat > /etc/systemd/network/03-wlan0.network <<EOF [Match] Name=wlan0

[Network] Address=10.1.4.1/24 DHCPServer=yes MulticastDNS=yes EOF

ActivateAccessPoint.sh

#! /bin/sh
# Script to Activate Access Point using systemd-networkd
# Assumes network configuration files and wpa_supplicant.conf file have been setup
# This script MUST be run by root or with sudo
# Reboot REQUIRED!

2022-07-20

echo "Activate Access Point using systemd-networkd"

if [ whoami != root ]; then echo "This script MUST be run by root or with sudo" exit fi

rm /etc/systemd/network/03-wlan.network systemctl enable systemd-networkd systemctl enable wpa_supplicant@wlan0.service

To revert to normal networkin re-run the the Simplified Systemd-Networkd setup procedure.

Milliways
  • 59,890
  • 31
  • 101
  • 209