linux PPPOE拨号上网

安装rp-pppoe

pacman -S rp-pppoe

配置

sudo pppoe-setup
>>> Enter your PPPoE user name:

这里输入网络运营商提供给你的用户名.

>>> 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. :

这里输入你链接网络的网卡,可以使用ip addr进行查看 比如eth1,wlo1.

>>> Enter the demand value (default no):

这里可以直接回车

>>> Enter the DNS information here:
>>> Enter the secondary DNS server address here:

这里输入两个DNS,比如1.1.1.1,8.8.8.8.

>>> Please 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):

这里我使用1,可以按照自己的需求选择防火墙配置.

启用

sudo pppoe-start

可以使用ip addr进行查看,现在应该有一个ppp0的网络.

查看路由确认启用

[ ~ ] route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         0.0.0.0         0.0.0.0         U     0      0        0 ppp0
                                ...
                                ...

如果没有default到ppp0的这条路由,需要手动创建:

sudo route add default dev ppp0

引用