LoginSignup
29
28

More than 5 years have passed since last update.

Raspberry PiをPocket Wifiで固定IPにする

Last updated at Posted at 2014-04-11

Raspberry Piを固定IPにする設定

イーモバイルのWifiルーターは暗号化方式をWEPとWPAをきりかえられるようになっているようですが、wpa_supplicant.confの設定方法が異なるようです。

/etc/network/interfacesの設定

$ sudo nano /etc/network/interfaces

DHCP

/etc/network/interfaces
auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

固定IP

/etc/network/interfaces
auto lo

allow-hotplug wlan0
iface lo inet loopback

iface wlan0 inet static
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
address 192.168.1.50
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 8.8.8.8

iface eth0 inet static
address 192.168.1.51
network 192.168.1.0
netmask 255.255.255.0
broadcast 192.168.1.255

Pocket Wifiと接続する設定

/etc/wpa_supplicant/wpa_supplicant.confの設定

$ sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

DHCP

/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
  ssid="xxxxxxxx"
  scan_ssid=1
  psk="xxxxxxxx"
  proto=RSN
  key_mgmt=WPA-PSK
  pairwise=CCMP
  auto_alg=OPEN
}

固定IP

WEPモード

/etc/wpa_supplicant/wpa_supplicant.conf
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
  scan_ssid=1
  key_mgmt=NONE
  ssid="xxxxxxxx"
  wep_key0="xxxxxxxx"
  wep_tx_keyidx=0
}

WPA2モード

/etc/wpa_supplicant/wpa_supplicant.conf

DNSの設定

/etc/resolv.confの設定

$ sudo nano /etc/resolv.conf
/etc/resolv.conf
nameserver 8.8.8.8
nameserver 8.8.4.4

設定を反映させる

$ sudo /etc/init.d/networking reload

本体を再起動しないと反映しないかもしれないです。

$ sudo shutdown -r now
29
28
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
29
28