有線LAN
有線LAN用固定IPの設定
$ sudo cp /etc/network/interfaces{,.orig} $ sudo vim /etc/network/interfaces
/etc/network/interfaces
auto lo iface lo inet loopback iface eth0 inet static address 192.168.21.41 netmask 255.255.255.0 gateway 192.168.21.1
該当IFの無効・有効化
$ sudo ifdown eth0 && sudo ifup eth0
無線LAN
無線LANクライアントの設定
$ sudo cp /etc/wpa_supplicant/wpa_supplicant.conf{,.orig} $ wpa_passphrase "RaspiSSID" "RaspiSSIDPW" | sudo tee -a /etc/wpa_supplicant/wpa_supplicant.conf network={ ssid="RaspiSSID" #psk="RaspiSSIDPW" psk=d721085129ab22a68036c3c5cf7d28dab5f9b3de93a8866fe6626d59e811b7f7 } $ sudo vim /etc/wpa_supplicant/wpa_supplicant.conf
/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev update_config=1 network={ ssid="RaspiSSID" scan_ssid=0 # スキャン方法(0:パッシブ、1:アクティブ) priority=0 # 値が大きいほど優先度が高い(デフォルトは0) proto=RSN # WPA2はRSNの別名 key_mgmt=WPA-PSK pairwise=TKIP CCMP group=CCMP psk=d721085129ab22a68036c3c5cf7d28dab5f9b3de93a8866fe6626d59e811b7f7 id_str="RaspiConf" # 識別名 }
無線LAN用固定IPの設定
$ sudo cp /etc/network/interfaces{,.orig} $ sudo vim /etc/network/interfaces
/etc/network/interfaces
auto lo iface lo inet loopback iface eth0 inet static address 192.168.21.41 netmask 255.255.255.0 gateway 192.168.21.1 allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp iface RaspiConf inet static address 192.168.21.42 netmask 255.255.255.0 gateway 192.168.21.1
該当IFの無効・有効化
$ sudo ifdown wlan0 && sudo ifup wlan0
リゾルバの設定
$ sudo vim /etc/resolv.conf $ cat /etc/resolv.conf nameserver 192.168.21.1 nameserver 192.168.22.1 search example.com example.jp
ホスト名の設定
$ sudo vim /etc/hostname $ cat /etc/hostname raspi
$ sudo vim /etc/hosts $ cat /etc/hosts 127.0.0.1 localhost.localdomain localhost 127.0.1.1 raspi.example.com raspi 192.168.11.41 raspi.example.com raspi 192.168.11.42 raspi.example.com raspi
再起動
$ sudo shutdown -r now
[参考URL]
How-To: WiFi roaming with wpa-supplicant | Debuntu
wpa_supplicant.conf(5)
Gentoo Linux ドキュメント -- 無線ネットワーク
0 件のコメント:
コメントを投稿