惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Microsoft Azure Blog
Microsoft Azure Blog
WordPress大学
WordPress大学
小众软件
小众软件
The Register - Security
The Register - Security
量子位
博客园_首页
T
The Blog of Author Tim Ferriss
T
Threat Research - Cisco Blogs
G
Google Developers Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
N
News and Events Feed by Topic
S
Security Affairs
O
OpenAI News
Google DeepMind News
Google DeepMind News
Webroot Blog
Webroot Blog
The Cloudflare Blog
雷峰网
雷峰网
酷 壳 – CoolShell
酷 壳 – CoolShell
IT之家
IT之家
Recent Commits to openclaw:main
Recent Commits to openclaw:main
V2EX - 技术
V2EX - 技术
S
Secure Thoughts
D
Docker
Cloudbric
Cloudbric
Vercel News
Vercel News
MongoDB | Blog
MongoDB | Blog
T
Troy Hunt's Blog
Blog — PlanetScale
Blog — PlanetScale
H
Hackread – Cybersecurity News, Data Breaches, AI and More
N
News and Events Feed by Topic
罗磊的独立博客
大猫的无限游戏
大猫的无限游戏
Schneier on Security
Schneier on Security
Jina AI
Jina AI
Stack Overflow Blog
Stack Overflow Blog
T
Threatpost
D
DataBreaches.Net
Spread Privacy
Spread Privacy
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Security Archives - TechRepublic
Security Archives - TechRepublic
T
Tor Project blog
P
Privacy & Cybersecurity Law Blog
T
Tenable Blog
V
Vulnerabilities – Threatpost
B
Blog RSS Feed
C
Cisco Blogs
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
F
Fortinet All Blogs
The Hacker News
The Hacker News
Know Your Adversary
Know Your Adversary

mephisto.cc

修复rime-ice无法弹出候选框的问题 开机滚动字体显示优化 个人网站安全防护 树莓派上部署Vaultwarden 使用goaccess实时分析Caddy日志 个人网站监控 Hugo全站AVIF记 Linux下尝试使用Godot开发小游戏 Arch linux dae 透明代理 Airflow接管galler-dl下载任务 如何使用gallery-dl批量下载图像 Arch核显下如何愉快玩Dota2和CS2 Arch/labwc 环境网络相关设置 Rime添加dota2词库 Arch 重装记录 Supertuxkart iOS版终于发布了 打造自己的流媒体音乐服务 剪切板管理工具clipcat推荐 MangoHud性能监控 微信小程序开发记 Rofi试用 解决Arch下VSCode无法输入中文的问题 独立窗口管理器下无法录屏问题处理 上海市二手房成交数据监控 OpenLDAP监控 Arch linux如何顺畅连接蓝牙设备 使用Git和Ansible管理配置文件 Arch Linux SSL VPN 客户端配置 简单获取celery任务实时结果 Arch linux下iNode客户端的安装和使用方法 券商费率调整记 迷你主机组装记 Labwc更换定制皮肤 树莓派跑分流代理 实用自动代理配置示例 九年老鼠标复活记 Openvpn示例 Mac下如何旋转webp图片 如何隐藏Vscode中Markdown PDF插件的头部内容 解决Linux下网络配置无法变更保存的问题 labwc环境启用wlogout Ubuntu下新官方微信尝鲜 简单检测用户是否开启广告屏蔽 Atuin ZFS下卡顿问题解决 Wine安装64位微信 Fish 和 Atuin使用记 Fastapi简单实现临时下载链接 Fastapi微信公众号开发简要 Hugo根据语种展示不同内容 如何修复Waybar微信图标错误 信封加密简要 Linux环境下维护公众号记录 快速隐藏和呼出终端 Wayland环境自动切换壁纸 SuperTuxKart 试玩 简单抓取雪球股票快讯 为什么你的kill命令不能列出信号表 Wine安装微信保姆教程 Hysteria科学上网简要 Ubuntu 23.10 钉钉无法启动解决方法 网站导航栏防止插入Adsense自动广告 Linux环境按键检测 Hugo文末添加最后修改时间 Wayland环境ksnip无法复制问题解决 我眼中的股票市场 Caddy简单图片防盗链 greetd和regreet使用教程 Wayland环境下截图加后期修改 Wayland 环境下gif录屏 Firefox的一些有趣功能 Ubuntu 切换系统语言 Firefox 标题栏高度调整 网站添加回到顶部功能 Hugo自定义字体 Labwc 便捷配置 Wofi使用教程 窗口管理器labwc使用记 文件共享软件Dufs推荐 Hugo静态站点接入Adsense广告 Fcitx5配置详解 Ubuntu安装chrome的方法总结 一种Xterm.js的全屏方案 Google网址收录api Python示例 手机听离线音乐 Snipe it资产导入 应用启动器yofi使用配置 Snipe it资产管理系统安装使用 Ubuntu开机启动加速 Vue3 vite TypeScript跨域等相关设置 Ubuntu手动升级Libreoffice Ubuntu设置alacritty为默认终端 简体文章批量转换为繁体 使用Inkscape调整svg图片大小 实用命令 使用mitmproxy给手机app抓包 Python中rstrip方法细解 Github同主机多仓库部署deploy key问题处理 Linux安装最新版本Python KeePassXC使用教程 Ubuntu 22.10连接蓝牙耳机报错br-connection-profile-unavailable解决方法
搭建树莓派无线路由器
2016-04-30 · via mephisto.cc

1. 采购硬件

  • 树莓派(去年买的Raspberry Pi 2 Model B 1GB 一直吃灰,不能忍)
  • USB无线网卡(购买链接:http://item.jd.com/509932.html),新版树莓派3自带无线模块,应该无需购买
  • 选用设备
    • 网线(方便调试)

2. 装树莓派官方系统,更新,基础配置

  • 略(不会配置,找个文档看看)

3. 安装 hostapd + udhcpd

apt-get install -y hostapd udhcpd
  • udhcpd 配置

      root@raspberrypi:~# cat /etc/udhcpd.conf
      start 192.168.42.2 # This is the range of IPs that the hostspot will give to client devices.
      end 192.168.42.20
      interface wlan0 # The device uDHCP listens on.
      remaining yes
      #opt dns 8.8.8.8 4.2.2.2 # The DNS servers client devices will use.
      opt dns 223.5.5.5 223.6.6.6 # The DNS servers client devices will use.
      opt subnet 255.255.255.0
      opt router 192.168.42.1 # The Pi's IP address on wlan0 which we will set up shortly.
      opt lease 864000 # 10 day DHCP lease time in seconds
    
  • hostapd 配置

    • 注意driver=rtl871xdrv 不是nl80211,因为奶茶东的usb网卡硬件不一样(rtl8192cu)
    • 替换/usr/sbin/hostapd这个二进制文件(外国友人链接:https://dl.dropboxusercontent.com/u/1663660/hostapd/hostapd)

    因为硬件的适配性问题,默默调试了3-4h,各种搜(树莓派3应该不存在这种问题)

      root@raspberrypi:~# lsusb |grep WLAN
      		Bus 001 Device 004: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
    
      root@raspberrypi:~# lshw -C network
      *-network:0
         description: Wireless interface
         physical id: 1
         bus info: usb@1:1.3
         logical name: wlan0
         serial: e8:4e:06:2a:5e:73
         capabilities: ethernet physical wireless
         configuration: broadcast=yes driver= rtl8192cu ip=192.168.42.1 multicast=yes wireless=IEEE 802.11bg
    

hostapd配置

	root@raspberrypi:~# cat /etc/hostapd/hostapd.conf
	interface=wlan0
	driver=rtl871xdrv
	ssid=行者孙
	hw_mode=g
	channel=6
	macaddr_acl=0
	auth_algs=1
	ignore_broadcast_ssid=0
	wpa=2
	wpa_passphrase=haha1234
	wpa_key_mgmt=WPA-PSK
	wpa_pairwise=TKIP
	rsn_pairwise=CCMP

4. 内核 iptable 网络 配置 启动项

  • 内核

      root@raspberrypi:~# grep net.ipv4.ip_forward=1 /etc/sysctl.conf
      net.ipv4.ip_forward=1
    
  • iptables

      root@raspberrypi:~# cat /etc/iptables.ipv4.nat
      # Generated by iptables-save v1.4.14 on Sat Apr 30 16:59:41 2016
      *filter
      :INPUT ACCEPT [23:1360]
      :FORWARD ACCEPT [0:0]
      :OUTPUT ACCEPT [21:3136]
      -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT
      -A FORWARD -i wlan0 -o eth0 -j ACCEPT
      COMMIT
      # Completed on Sat Apr 30 16:59:41 2016
      # Generated by iptables-save v1.4.14 on Sat Apr 30 16:59:41 2016
      *nat
      :PREROUTING ACCEPT [2:156]
      :INPUT ACCEPT [2:156]
      :OUTPUT ACCEPT [1:108]
      :POSTROUTING ACCEPT [0:0]
      -A POSTROUTING -o eth0 -j MASQUERADE
      COMMIT
      # Completed on Sat Apr 30 16:59:41 2016
    
  • 网络配置

      root@raspberrypi:~# cat /etc/network/interfaces
      auto lo
      iface lo inet loopback
      iface eth0 inet dhcp
    
      auto eth0
      allow-hotplug eth0
    
      auto wlan0
      allow-hotplug wlan0
      iface wlan0 inet static
        address 192.168.42.1
        netmask 255.255.255.0
    
      pre-up iptables-restore < /etc/iptables.ipv4.nat
    
  • 启动项

      root@raspberrypi:~# history | grep enable
        103  update-rc.d udhcpd enable
        104  update-rc.d hostapd enable
    

4. 手机电脑连接测试,效果感人

测试速度很快。主观自我肯定,客观硬件配置的确秒杀绝大部分路由器

ssid:行者孙
password: haha1234

5. 总结

Hi, GNU/linux 陪伴是最长情的告白,等我财务自由了我赚钱给你!

  • 消灭没有女朋友的无聊的人山人海的五一假期
  • 拥有一个自由控制的linux router
  • 自我陶醉
  • 物尽所用