Linux下pppoe设置
在Linux下配置pppoe,一般有以下步骤:
1. 安装pppoe软件。这个不多说,ape-get install pppoe即可。
2. 设置拨号属性:
root@ubuntu:~# pppoe-setup
详细过程如下:
用户名:
USER NAME >>> Enter your PPPoE user name (default test): test
接口(网卡):
INTERFACE >>> Enter the Ethernet interface connected to the DSL modem For Solaris, this is likely to be something like /dev/hme0. For Linux, it will be ethn, where 'n' is a number. (default eth0): eth0
dns:
>>> Enter the DNS information here:
密码:
PASSWORD >>> Please enter your PPPoE password: >>> Please re-enter your PPPoE password:
防火墙:
The firewall choices are: 0 - NONE: This script will not set any firewall rules. You are responsible for ensuring the security of your machine. You are STRONGLY recommended to use some kind of firewall rules. 1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation 2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway for a LAN >>> Choose a type of firewall (0-2): 0
保存设置:
Ethernet Interface: eth0 User name: test Activate-on-demand: No DNS: Do not adjust Firewalling: NONE >>> Accept these settings and adjust configuration files (y/n)? y
保存成功了。
Congratulations, it should be all set up! Type 'pppoe-start' to bring up your PPPoE link and 'pppoe-stop' to bring it down. Type 'pppoe-status' to see the link status.
3. 开始拨号
root@ubuntu:~# pppoe-start
到了这一步,如果没有问题的话,应该就可以正常连上pppoe服务器了。
4. 断开链接
root@ubuntu:~# pppoe-stop
但在实际操作时,我遇到了以下两个问题:
问题1:
root@ubuntu:~ Welcome to the Roaring Penguin PPPoE client setup. First, I will run some checks on your system to make sure the PPPoE client is installed properly... Oops, I can't execute the program '/usr/local/sbin/pppd'. You must install the PPP software suite, version 2.3.10 or later.
原因:目录/usr/local/sbin/没有pppd文件
解决方法:
将/usr/sbin/pppoe-setup脚本里PPPD=/usr/local/sbin/pppd
改为PPPD=/usr/sbin/pppd,保存修改后即恢复可正常
问题2:
root@ubuntu:~# pppoe-status: Link is down (can't read pppoe PID file /var/run/pppoe.conf-pppoe.pid.pppoe)
尝试运行pppoe-connect,出现和问题一类似的错误
原因:同问题1所述
解决方法和问题1中类似:
将/usr/sbin/pppoe-connect脚本里PPPD=/usr/local/sbin/pppd
改为PPPD=/usr/sbin/pppd,保存修改后即恢复可正常
总结:
在配置pppoe时遇到奇怪的问题,很有可能是有相应的脚本的路径设置不当造成。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· DeepSeek 开源周回顾「GitHub 热点速览」
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了