Use Raspberry Pi as Router with PPPoE

中文版在这里 The router at my home has been troubled by the high temperature during summer days, and its performance has brought me headaches whenever I needed smooth network. Raspberry Pi is a robust mini-computer and I soon committed to the idea to turn a Raspi 3 into my new router. After 8-hour trial-and-error I finally … [Read more…]

如何用树莓派自制路由器

Click here to view the English version of the tutorial 最近家里wifi连续使用时间一长就会出现速度大幅度波动,严重影响了我上王者的速度,估摸着应该是路由器扛不住夏天的高温,所以脑回路一转觉得可以用手头的树莓派替代路由器。反正树莓派3又有ethernet接口又有wifi模块,理论上实现应该很简单,然而一如往常我又给自己挖了个坑。8个小时后重新连接上文明社会互联网的我写下了这篇教程。 网上有多篇类似教程但是出于各种原因在我的树莓派3上都没有实验成功,这篇教程大多数内容借鉴自Medium上的Turn a RaspBerryPi 3 into a WiFi router-hotspot(需要科学上网)。 首先你需要一个树莓派。我用的是树莓派3代B型和最新的Raspbian系统。B+型跟B型区别不大应该没问题,zero W型应该也可以,我很想试验一下但是没钱买,老版的树莓派可能需要配上一个usb wifi模块。 家里的宽带是网线入户但是需要用运营商提供的账号密码来上网,也就是PPPoE,国内大多数家里用的应该是类似的网。我们需要一个叫pppoeconf的工具来让树莓派接上互联网,去这里下载安装包,国内的话点击“ftp.cn.debian.org/debian”下载会快一些。下载好以后sudo dpkg -i pppoeconf_1.21_all.deb来安装这个deb。接着把树莓派直接连接上网线,用sudo pppoeconf打开程序,跟着GUI一路设置就好了。这时候打开浏览器确认一下树莓派可以上网。 接着例行 sudo apt-get update sudo apt-get dist-upgrade 安装两个程序 sudo apt-get install hostapd isc-dhcp-server 然后sudo nano /etc/dhcp/dhcpd.conf,把 option domain-name “example.org”; option domain-name-servers ns1.example.org, ns2.example.org; 这两行前面加#号注释掉。把 #authoritative; 前面的#号去掉。接着到文件的最后加上 subnet 192.168.42.0 … [Read more…]

DIY Locked Door Detector

Did you lock the door today? Let me ask again: did you lock the door today? Are you sure you do not want to go back and check? … Welcome back. After few times waking up and finding the apartment door unlocked, I decided to do something to save myself from my carelessness. The idea … [Read more…]