Skip to content

Instantly share code, notes, and snippets.

@kjunichi
Last active December 15, 2015 10:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kjunichi/5245370 to your computer and use it in GitHub Desktop.
Save kjunichi/5245370 to your computer and use it in GitHub Desktop.

Raspberry piをWifiのアクセスポイントにする

sudo apt-get install hostapd

/etc/hostapd/hostapd.conf

interface=wlan0
driver=nl80211
ssid=WLAN
hw_mode=g
channel=11
wpa=2
wpa_passphrase=abrakatabura
wpa_key_mgmt=WPA-PSK
rsn_pairwise=CCMP

/etc/network/interfaces

allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.1
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
post-up /bin/echo "1" > /proc/sys/net/ipv4/ip_forward

eth0で外に出られるようにする

デフォルトゲートウェイの設定

eth0にケーブル指して、LANにアクセスできる状態から始めていれば不要なはず。 Wifiでクライアントモードで立ち上げて、途中から作業する場合に必要になる模様。

sudo route add default gw 192.168.0.1

IPマスカレードでwlan0のパケットをeth0を通って外に出られるようにする

参考になったページ

関連Gist

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment