Linux下pppoe设置

本文详细介绍了在Linux环境下配置pppoe的过程,并针对遇到的两个常见问题提供了解决方案。通过修改脚本中pppd文件的路径设置,可以解决无法执行pppd程序和pppoe-status显示链接关闭的问题,从而实现正常连接pppoe服务器。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在Linux下配置pppoe,一般有以下步骤:

1. 安装pppoe软件。这个不多说,ape-get install pppoe即可。

2. 设置拨号属性:

[cpp]  view plain copy
  1. root@ubuntu:~# pppoe-setup  

   详细过程如下:

     用户名:

[cpp]  view plain copy
  1. USER NAME  
  2.   
  3. >>> Enter your PPPoE user name (default test): test  

     接口(网卡):

[cpp]  view plain copy
  1. INTERFACE  
  2.   
  3. >>> Enter the Ethernet interface connected to the DSL modem  
  4. For Solaris, this is likely to be something like /dev/hme0.  
  5. For Linux, it will be ethn, where 'n' is a number.  
  6. (default eth0): eth0  

      dns:

[cpp]  view plain copy
  1. >>> Enter the DNS information here:  

      密码:

[cpp]  view plain copy
  1. PASSWORD  
  2.   
  3. >>> Please enter your PPPoE password:      
  4. >>> Please re-enter your PPPoE password:   

      防火墙:

[cpp]  view plain copy
  1. The firewall choices are:  
  2. 0 - NONE: This script will not set any firewall rules.  You are responsible  
  3.           for ensuring the security of your machine.  You are STRONGLY  
  4.           recommended to use some kind of firewall rules.  
  5. 1 - STANDALONE: Appropriate for a basic stand-alone web-surfing workstation  
  6. 2 - MASQUERADE: Appropriate for a machine acting as an Internet gateway  
  7.                 for a LAN  
  8. >>> Choose a type of firewall (0-2): 0  

   保存设置:

[cpp]  view plain copy
  1. Ethernet Interface: eth0  
  2. User name:          test  
  3. Activate-on-demand: No  
  4. DNS:                Do not adjust  
  5. Firewalling:        NONE  
  6.   
  7. >>> Accept these settings and adjust configuration files (y/n)? y  

  保存成功了。

[cpp]  view plain copy
  1. Congratulations, it should be all set up!  
  2.   
  3. Type 'pppoe-start' to bring up your PPPoE link and 'pppoe-stop' to bring  
  4. it down.  Type 'pppoe-status' to see the link status.  

3. 开始拨号

[cpp]  view plain copy
  1. root@ubuntu:~# pppoe-start  

到了这一步,如果没有问题的话,应该就可以正常连上pppoe服务器了。

 

 

但在实际操作时,我遇到了以下两个问题:

问题1:

[cpp]  view plain copy
  1. root@ubuntu:~# pppoe-setup  
  2. Welcome to the Roaring Penguin PPPoE client setup.  First, I will run  
  3. some checks on your system to make sure the PPPoE client is installed  
  4. properly...  
  5.   
  6. Oops, I can't execute the program '/usr/local/sbin/pppd'.  You  
  7. 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:

[cpp]  view plain copy
  1. 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时遇到奇怪的问题,很有可能是有相应的脚本的路径设置不当造成。



获取公网ip

1 curl ifconfig.me
2 #或者
3 curl http://members.3322.org/dyndns/getip

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值