設定手順

  • ネットワーク周り

有線LANと無線LANそれぞれのネットワーク設定 /etc/network/interface を以下

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet manual

# auto wlan0
allow-hotplug wlan0
iface wlan0 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

#allow-hotplug wlan1
#iface wlan1 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
  • アクセスポイント設定

アクセスポイントのSSID、パスワードとか /etc/hostapd/hostapd.conf を以下

#新規作成
interface=wlan0
driver=nl80211
#driver=rtl871xdrv
ssid=Pi3-AP
hw_mode=g
channel=6
ieee80211n=1
wmm_enabled=1
ht_capab=[HT40][SHORT-GI-20][DSSS_CCK-40]
macaddr_acl=0
auth_algs=1
ignore_broadcast_ssid=0
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_passphrase=raspberry
rsn_pairwise=CCMP

IP割り振りのための設定 IPアドレスの範囲とか。 isc-dhcp-server の設定 /etc/dhcp/dhcpd.conf は以下

#global
ddns-update-style none;
ignore client-updates;
log-facility local7;
not authoritative;

#subnet
subnet 192.168.42.0 netmask 255.255.255.0 {
option routers 192.168.42.1;
option subnet-mask 255.255.255.0;
option domain-name "local.tooyama.org";
option domain-search "local.tooyama.org";
option domain-name-servers 192.168.42.6;
range dynamic-bootp 192.168.42.150 192.168.42.239;
default-lease-time 21600;
max-lease-time 43200;
}
  • アダプタ設定

サーバとしての機能は wlan0 /etc/default/isc-dhcp-server 以下

# Defaults for isc-dhcp-server (sourced by /etc/init.d/isc-dhcp-server)

# Path to dhcpd's config file (default: /etc/dhcp/dhcpd.conf).
#DHCPDv4_CONF=/etc/dhcp/dhcpd.conf
#DHCPDv6_CONF=/etc/dhcp/dhcpd6.conf

# Path to dhcpd's PID file (default: /var/run/dhcpd.pid).
#DHCPDv4_PID=/var/run/dhcpd.pid
#DHCPDv6_PID=/var/run/dhcpd6.pid

# Additional options to start dhcpd with.
#       Don't use options -cf or -pf here; use DHCPD_CONF/ DHCPD_PID instead
#OPTIONS=""

# On what interfaces should the DHCP server (dhcpd) serve DHCP requests?
#       Separate multiple interfaces with spaces, e.g. "eth0 eth1".
# INTERFACESv4="wlan0"
# INTERFACESv6="wlan0"
INTERFACES="wlan0"
  • デフォルト設定

hostapd の初期設定

# Additional daemon options to be appended to hostapd command:-
#       -d   show more debug messages (-dd for even more)
#       -K   include key data in debug messages
#       -t   include timestamps in some debug messages
#
# Note that -B (daemon mode) and -P (pidfile) options are automatically
# configured by the init.d script and must not be added to DAEMON_OPTS.
#
DAEMON_OPTS="/etc/hostapd/hostapd.conf"
  • 動作確認

サーバの再起動 コマンド

service isc-dhcp-server restart