Ubuntu下DSL拨号上网频繁断网解决方法
打开配置文件/etc/ppp/options
sudo vi /etc/ppp/options
# 不熟悉vi的同学可以使用gedit
sudo gedit /etc/ppp/options
在options文件中找到以下两行代码
lcp-echo-failure 4
相当于断线之后发送的心跳帧,即重连次数。
If this option is given, pppd will send an LCP echo-request frame to the peer every n seconds.
lcp-echo-interval 30
重连周期
If this option is given, pppd will presume the peer to be dead if n
LCP echo-requests are sent without receiving a valid LCP echo-reply. If this happens, pppd will terminate the connection.
两个字段的意思就是每30秒内重连一次,4次重连失败就自动断网,把4改大点,比如40、400。
Ubuntu下网络管理的其他命令
# 安装pppoe组件
sudo apt-get install pppoe pppoeconf
# 图形界面配置pppoe,等同于“编辑连接”
nm-connection-editor
# 命令行界面配置pppoe
sudo pppoeconf
# 联网,自动DSL拨号连接
sudo pon dsl-provider
# 断网,停止DSL拨号连接
sudo poff
# 重启网络服务
sudo service network-manager restart