树莓派实现PPPOE拨号上网
2021-03-25 12:06:20 来源:华启智能
如果树莓派安装了官方Raspbian系统,如果通过网线直接连接家里的无线路由器,树莓派就可以正常上网了。但是,如果你的家中没有路由器,只有有线宽带,而且是通过运营商提供的账号和密码上网的,那你的这种上网方式就属于PPPOE拨号上网。
1. 安装pppoe、pppoeconf和pppstatus
sudo apt-get install pppoe pppoeconf pppstatus
2. 配置pppoe
pppoeconf
运行pppoeconf命令,然后,一路点击“是”就可以了,当然中间会提示你输入你的PPPOE上网帐号和密码。
3. 查看是否有生成ppp0
ifconfig
运行ifconfig命令,会得到类似如下内容:
eth0 Link encap:Ethernet HWaddr 00:0F:1F:CD:2Array:AE
inet6 addr: fe80::20f:1fff:fecd:2Arrayae/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7024 errors:0 dropped:0 overruns:0 frame:0
TX packets:1330 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:274243Array (2.6 MiB) TX bytes:20651Array (201.6 KiB)
Interrupt:11
eth0:avah Link encap:Ethernet HWaddr 00:0F:1F:CD:2Array:AE
inet addr:16Array.254.6.1Array1 Bcast:16Array.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:11
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:16436 Metric:1
RX packets:1382 errors:0 dropped:0 overruns:0 frame:0
TX packets:1382 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:104872 (102.4 KiB) TX bytes:104872 (102.4 KiB)
ppp0 Link encap:Point-to-Point Protocol
inet addr:218.85.21.75 P-t-P:202.101.ArrayArray.13Array Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:14Array2 Metric:1
RX packets:1108 errors:0 dropped:0 overruns:0 frame:0
TX packets:1188 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:815436 (7Array6.3 KiB) TX bytes:1581Array8 (154.4 KiB)
可以看到,已经生产了ppp0,恭喜你,你的树莓派已经可以正常上网了。
标签:树莓派