linux PPPOE拨号上网

安装rp-pppoe

1
pacman -S rp-pppoe

配置

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

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

1
2
3
>>> 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.

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

这里可以直接回车

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

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

1
>>> Please enter your PPPoE password:

这里输入网络运营商提供给你的密码.

1
2
3
4
5
6
7
8
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,可以按照自己的需求选择防火墙配置.

启用

1
sudo pppoe-start

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

查看路由确认启用

1
2
3
4
5
6
[ ~ ] 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的这条路由,需要手动创建:

1
sudo route add default dev ppp0

引用