ラズパイに無線LANサーバ(wlan0)と無線LANクライアント(wla1)を併設する方法
kw: WiFi2枚 USB WiFi
完成したカーネルイメージ /home/kobore/www/soft/hitachi_ride_hailing_go/20190823-WiFi2.img
sudo apt install -y isc-hdcp-server
sudo apt install -y hostapd
とインストールしておく
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="b8:27:eb:ec:9c:0b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0" SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="d0:37:45:30:71:23", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan1"
interface wlan0 static ip_address=192.168.101.1/24 static routers=192.168.101.1 static domain_name_servers=192.168.101.1
default-lease-time 600; max-lease-time 7200; ddns-update-style none; authoritative; subnet 192.168.101.0 netmask 255.255.255.0 { range 192.168.101.10 192.168.101.200; option broadcast-address 192.168.101.255; option routers 192.168.101.1; default-lease-time 600; max-lease-time 7200; option domain-name-servers 8.8.8.8, 8.8.4.4; }
interface=wlan0 driver=nl80211 ssid=rp1 hw_mode=g channel=6 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=password wpa_key_mgmt=WPA-PSK wpa_pairwise=CCMP wpa_group_rekey=86400 ieee80211n=1 wme_enabled=1
log_daemon_msg “Starting $DESC” “$NAME” sleep 10
auto wlan0 allow-hotplug wlan0 iface wlan0 inet static wpa-conf /etc/wpa_supplicant/wpa_supplicant_wlan0.conf
auto wlan1 allow-hotplug wlan1 iface wlan1 inet dhcp wpa-conf /etc/wpa_supplicant/wpa_supplicant_wlan1.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=JP network={ ssid="ssid" psk="password" key_mgmt=WPA-PSK }
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 country=JP network={ ssid="iPhone" psk="9yniyg4p4cmh1" }
wlan0: flags=4163mtu 1500 inet 192.168.101.1 netmask 255.255.255.0 broadcast 192.168.101.255 inet6 fe80::1392:b0b4:b56a:836b prefixlen 64 scopeid 0x20 ether b8:27:eb:ec:9c:0b txqueuelen 1000 (イーサネット) RX packets 685 bytes 61030 (59.5 KiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 148 bytes 23267 (22.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlan1: flags=4163 mtu 1500 inet 172.20.10.4 netmask 255.255.255.240 broadcast 172.20.10.15 inet6 fe80::e4a8:f21f:a6fa:111f prefixlen 64 scopeid 0x20 ether d0:37:45:30:71:23 txqueuelen 1000 (イーサネット) RX packets 28 bytes 4774 (4.6 KiB) RX errors 0 dropped 30 overruns 0 frame 0 TX packets 50 bytes 8415 (8.2 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0