Open ShogoHirasawa opened 2 years ago
ssh pi@raspberrypi.local
cat << _EOF_ | sudo tee -a /etc/dhcpcd.conf interface eth0 static ip_address=192.168.10.1/24 _EOF_ sudo systemctl restart dhcpcd
sudo apt update -y sudo apt install dnsmasq sudo apt install -y apache2 sudo apt install -y hostapd sudo apt upgrade -y sudo apt autoremove -y sudo apt-get install isc-dhcp-server sudo apt-get install rng-tools
sudo systemctl stop wpa_supplicant sudo systemctl disable wpa_supplicant
sudo echo "interface wlan0" >> /etc/dhcpcd.conf sudo echo "static ip_address=192.168.20.1/24" >> /etc/dhcpcd.conf
sudo systemctl restart dhcpcd
cat << _EOF_ | sudo tee /etc/hostapd/hostapd.conf interface=wlan0 driver=nl80211 hw_mode=b channel=1 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 ieee80211ac=0 wmm_enabled=1 ieee80211d=1 country_code=JP ieee80211h=1 local_pwr_constraint=3 spectrum_mgmt_required=1 wpa=3 wpa_key_mgmt=WPA-PSK ssid=dronebird wpa_passphrase=dronebird _EOF_ sudo sed -i -e "s@#DAEMON_CONF=\"\"@DAEMON_CONF=\"/etc/hostapd/hostapd.conf\"@g" /etc/default/hostapd
デーモンを有効化
sudo systemctl unmask hostapd sudo systemctl enable hostapd sudo systemctl start hostapd
nano /etc/dhcp/dhcpd.conf
subnet 192.168.2.0 netmask 255.255.255.0 { range 192.168.2.100 192.168.2.200; option broadcast-address 192.168.2.255; default-lease-time 600; max-lease-time 7200; }
sudo systemctl enable isc-dhcp-server sudo systemctl restart isc-dhcp-server
Wi-Fiの一覧に表示されず...。
ssh 接続
ラズパイ側のIPの固定
パッケージインストール
Wi-Fiクライアントとしての設定を無効化
dhcpcdの設定を固定IPに変える
hostapdの設定
デーモンを有効化
isc-dhcp-serverの設定