menu E4b9a6's blog
rss_feed
E4b9a6's blog
有善始者实繁,能克终者盖寡。

Linux宽带拨号

作者:E4b9a6, 创建:2024-08-15, 字数:2830, 已阅:177, 最后更新:2024-08-15

在 Debian10 下进行 pppoe 拨号并获得 IPV6 地址

首先安装 pppconf

Bash
sudo apt update
sudo apt install pppoeconf

配置宽带信息

Bash
sudo pppoeconf

通常配置完成后会自动连接宽带,如果没有,执行以下命令进行拨号:

Bash
# 拨号
sudo pon dsl-provider
# 断开
sudo poff dsl-provider

拨号后使用 ip a 检查连接情况:

Bash
root@arm-64 /etc/apt$ ip a                                                                                                                                                                
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether 02:00:00:22:30:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.4.20/20 brd 192.168.15.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fd1c:b796:b00f:3f00:c0c1:edd1:ca74:ff66/64 scope global dynamic noprefixroute 
       valid_lft 7164sec preferred_lft 3564sec
    inet6 240e:47d:609:3623:8f78:311c:7b97:57b2/64 scope global dynamic noprefixroute 
       valid_lft 7164sec preferred_lft 3564sec
    inet6 fe80::ff:fe22:3001/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
3: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1492 qdisc pfifo_fast state UNKNOWN group default qlen 3
    link/ppp 
    inet 1.1.1.1 peer 100.75.0.1/32 scope global ppp0
       valid_lft forever preferred_lft forever
    inet6 240e:3f0:6c4:8se2:203:e3:aa22:3s01/64 scope global dynamic mngtmpaddr 
       valid_lft 2591567sec preferred_lft 604367sec
    inet6 fe80::200:e6:a322:3001/10 scope link 
       valid_lft forever preferred_lft forever

开机显示 ppp0 状态为 Down ,检查 /etc/network/interface 中的配置应如下:

TEXT
...

# PPPoE configuration
auto dsl-provider
iface dsl-provider inet ppp
    pre-up /bin/ip link set eth0 up # Ensure eth0 is up before starting PPPoE
    provider dsl-provider

拨号失败,检查 /etc/ppp/chap-secrets/etc/ppp/pap-secrets 文件中配置正确:

TEXT
# /etc/ppp/chap-secrets
# Secrets for authentication using CHAP
# client        server  secret                  IP addresses
"your_pppoe_username" * "your_pppoe_password"

# /etc/ppp/pap-secrets
# Secrets for authentication using PAP
# client        server  secret                  IP addresses
"your_pppoe_username" * "your_pppoe_password"

pppoeconf 通常默认支持 ipv6 ,如果没有则需要手动添加

编辑文件: /etc/ppp/peers/dsl-provider

TEXT
...
+ipv6
ipv6cp-accept-local

编辑文件: /etc/ppp/options

TEXT
+ipv6
ipv6cp-use-persistent
ipv6cp-accept-local

编辑文件: /etc/network/interfaces

TEXT
...
iface ppp0 inet6 auto

重新拨号查看是否获得 ipv6 地址


[[replyMessage== null?"发表评论":"发表评论 @ " + replyMessage.m_author]]

account_circle
email
web_asset
textsms

评论列表([[messageResponse.total]])

还没有可以显示的留言...
gravatar
[[messageItem.m_author]] [[messageItem.m_author]]
[[messageItem.create_time]]
[[getEnviron(messageItem.m_environ)]]
[[subMessage.m_author]] [[subMessage.m_author]] @ [[subMessage.parent_message.m_author]] [[subMessage.parent_message.m_author]]
[[subMessage.create_time]]
[[getEnviron(messageItem.m_environ)]]