Help us understand the problem. What is going on with this article?

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

More than 5 years have passed since last update.

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
Why do not you register as a user and use Qiita more conveniently?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away