树莓派3B搭建openwrt软路由
使用树莓派3b搭建软路由
1.树莓派做主路由
2.树莓派做旁路由
3.树莓派做子路由
目的是为了实现以下网络拓扑:树莓派做为一个AP,连接家里的路由器:

步骤:
使用win32disk软件把openwrt烧录到sd卡上
树莓派连上屏幕和键盘开机,passwd新增root的密码
开机后修改vi /etc/config/network
config interface 'loopback' option ifname 'lo' option proto 'static' option ipaddr '127.0.0.1' option netmask '255.0.0.0' config globals 'globals' option ula_prefix 'fda0:8c6e:a39a::/48' config interface 'lan' option type 'bridge' option proto 'static' option ipaddr '192.168.1.118' #不要合上级路由的ip地址冲突 option netmask '255.255.255.0' option ip6assign '60'
修改vi /etc/config/wireless
config wifi-device 'radio0' ... option disabled '0' #此处需要由1改为0 开启Wi-Fi config wifi-iface 'default_radio0' ... option ssid 'OpenWrt' #WiFi名称 option encryption 'psk2' #常用 看个人喜好 option key 'xxxxxxxx' #WiFi密码
使用家里电脑连上OpenWrt网络,登陆192.168.1.118
修改lan口 增加网关和dns Physical Settings选项下去掉Ethernet Adapter: “eth0” (lan)选项的☑️
添加wan口 依次打开“Network” > “Interfaces”,点击“Add new interface…”打开新建接口的界面“Create Interface”,如下修改: “Name of the new interface”处,填入“WAN”。 “Protocol of the new interface” 选择 “dhcp client" 防火墙设置“Firewall Settings” 选择wan口
Last updated
Was this helpful?