世事經常變動不居!實務工作者總是煩惱不斷?本想著用樹莓派作 AP 不過小菜一碟,早已知知的哩︰
Pi-Point – turn your Raspberry Pi into a wireless access point
I was shown Pi Point before the holidays, but thought it was best to wait until now to spring it on you, because so many of you have got Pis for Christmas and are looking for projects to use them in.
Guy Eastwood has documentation and an SD card image which will allow you to turn your Pi into a wireless access point. With a bit of imagination applied, you can find a million uses for a tiny, waterproofable (think Tupperware and epoxy), cheap access point; of course, you can just use it to extend your home network, but the possibilities get really interesting if you think outside the box. You can build a guest network, firewalled off from your local network. You can learn about network hardening. With the addition of a home-made cantenna, you could set up a line of Pis as relays to get WiFi down to the shed in your allotment, or point a signal at your treehouse. If you’re an altruist, you can provide your local bus stop with free WiFi.
Let us know what you end up doing with Pi-Point. We’d love to hear what you come up with!
……
Turn your Raspberry Pi into a Wireless Access Point
Welcome and thank you for dropping by. If you’re a Raspberry Pi owner and are curious about some of the things you can do with it then this is where you can learn how to turn it into a WiFi Access Point.
There’s all sorts of reasons why you may want to do this…
- Extend your existing WiFi network
- Learn more about wireless networking
- Create a free Access Point
- Build a honeytrap to learn about network-hardening
- Learn about sniffing packets
- Provide guest wireless access firewalled off/through your main network
- Closed wifi monitoring station, e.g. temperature sensor, weather recording
- Create a Raspberry Pi WiFi HotSpot
Given that you have a Pi, though one of the main reasons is likely to be ‘because you can’ !
To get started, follow the Documentation link above to be guided through setting up a Pi-Point from operating system install to fully working, I hope you find this useful!
– Guy Eastwood
───
怎曉按表操課,依樣葫蘆︰
pi@raspberrypi:~ cat /etc/hostapd/hostapd.conf interface=wlan1 driver=nl80211 ssid=freesandal hw_mode=g channel=10 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=freesandal wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
# If you want dnsmasq to listen for DHCP and DNS requests only on # specified interfaces (and the loopback) give the name of the # interface (eg eth0) here. # Repeat the line for more than one interface. interface=wlan1 # This is an example of a DHCP range where the netmask is given. This # is needed for networks we reach the dnsmasq DHCP server via a relay # agent. If you don't know what a DHCP relay agent is, you probably # don't need to worry about this. dhcp-range=192.168.8.50,192.168.8.150,255.255.255.0,12h # Send an empty WPAD option. This may be REQUIRED to get windows 7 to behave. dhcp-option=252,"\n"
pi@raspberrypi:~ cat /etc/network/interfaces # interfaces(5) file used by ifup(8) and ifdown(8) # Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' # Include files from /etc/network/interfaces.d: source-directory /etc/network/interfaces.d auto lo iface lo inet loopback iface eth0 inet manual allow-hotplug wlan0 iface wlan0 inet manual wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf # allow-hotplug wlan1 # iface wlan1 inet manual # wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf iface wlan1 inet static address 192.168.8.1 netmask 255.255.255.0 pi@raspberrypi:~ sudo nano /etc/dnsmasq.conf pi@raspberrypi:~ cat /etc/init.d/pipoint #!/bin/sh # Configure Wifi Access Point. # ### BEGIN INIT INFO # Provides: WifiAP # Required-Start: syslog remote_fs time # Should-Start: named slapd autofs ypbind nscd nslcd # Should-Stop: named slapd autofs ypbind nscd nslcd # Default-Start: 2 # Default-Stop: # Short-Description: Wifi Access Point configuration # Description: Sets forwarding, starts hostap, enables NAT in iptables ### END INIT INFO # turn on forwarding echo 1 > /proc/sys/net/ipv4/ip_forward # enable NAT iptables -t nat -A POSTROUTING -j MASQUERADE # start the access point hostapd -B /etc/hostapd/hostapd.conf pi@raspberrypi:~ sudo update-rc.d pipoint start 99 2 update-rc.d: warning: start and stop actions are no longer supported; falling back to defaults pi@raspberrypi:~ ifconfig eth0 Link encap:Ethernet HWaddr b8:27:eb:8a:12:64 inet addr:5.168.168.19 Bcast:5.168.168.255 Mask:255.255.255.0 inet6 addr: fe80::629a:af0a:4cf8:32ee/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:113 errors:0 dropped:1 overruns:0 frame:0 TX packets:134 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:17998 (17.5 KiB) TX bytes:26380 (25.7 KiB) lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:65536 Metric:1 RX packets:116 errors:0 dropped:0 overruns:0 frame:0 TX packets:116 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1 RX bytes:23001 (22.4 KiB) TX bytes:23001 (22.4 KiB) wlan0 Link encap:Ethernet HWaddr b8:27:eb:df:47:31 inet6 addr: fe80::593e:a20:e109:ff10/64 Scope:Link UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:195 errors:0 dropped:194 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:65281 (63.7 KiB) TX bytes:261 (261.0 B) # 那ㄟ啊ㄋㄟ?? wlan1 Link encap:Ethernet HWaddr 7c:dd:90:7a:62:5a inet addr:169.254.157.11 Bcast:169.254.255.255 Mask:255.255.0.0 inet6 addr: fe80::9622:163b:b34c:5446/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1 errors:0 dropped:0 overruns:0 frame:0 TX packets:56 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:135 (135.0 B) TX bytes:12186 (11.9 KiB) pi@raspberrypi:~ cat /etc/rc.local #!/bin/sh -e # # rc.local # # This script is executed at the end of each multiuser runlevel. # Make sure that the script will "exit 0" on success or any other # value on error. # # In order to enable or disable this script just change the execution # bits. # # By default this script does nothing. # Print the IP address _IP=_IP" ]; then printf "My IP address is %s\n" "
pi@raspberrypi:~
又得探究乎!!