解决Ubuntu16.04拨号上网及有线连接频繁断网的问题

最近从Ubuntu14.04换到了16.04,学校又从锐捷校园网换成了深澜,于是上网时候遇到了一些小问题。

首先解决在Ubuntu下拨号上网

首先终端输入

  1. $ sudo pppoeconf

之后就会出现一个界面,一直选yes就可以(Enter键确认,Tab键切换选项)

之后到了输入用户名和密码,务必记得将原位置的文字删干净

之后还是一路yes就搞定了

之后上网只要在终端中输入下面命令就可以了

  1. $ sudo pon dsl-provider

如果要切断网络

  1. $ sudo poff dsl-provider

 

解决频繁断网的问题

以上就解决了Ubuntu拨号上网的问题,但是连上网之后想要看一下网页发现经常打不开网页,频繁断网,于是在终端中测试了一下网络果然是网络连接断断续续的。

  1. leo@TP-L440:~$ ping www.baidu.com
  2. PING www.a.shifen.com (220.181.112.244) 56(84) bytes of data.
  3. 64 bytes from 220.181.112.244: icmp_seq=1 ttl=50 time=18.8 ms
  4. ping: sendmsg: Network is unreachable
  5. ping: sendmsg: Network is unreachable
  6. ping: sendmsg: Network is unreachable
  7. 64 bytes from 220.181.112.244: icmp_seq=6 ttl=50 time=18.8 ms
  8. 64 bytes from 220.181.112.244: icmp_seq=7 ttl=50 time=18.7 ms
  9. ping: sendmsg: Network is unreachable
  10. ping: sendmsg: Network is unreachable
  11. ping: sendmsg: Network is unreachable
  12. ping: sendmsg: Network is unreachable
  13. ping: sendmsg: Network is unreachable

 

针对这个问题,改一下配置文件就可以解决

终端输入

  1. $ sudo gedit /etc/ppp/peers/dsl-provider

将配置文件按如下更改(更改lcp-echo-interval、lcp-echo-failure、mtu、persist、maxfail、holdoff

  1. # Minimalistic default options file for DSL/PPPoE connections
  2. noipdefault
  3. defaultroute
  4. replacedefaultroute
  5. hide-password
  6. #lcp-echo-interval 30
  7. #lcp-echo-failure 4
  8. lcp-echo-interval 10
  9. lcp-echo-failure 10
  10. noauth
  11. persist
  12. #mtu 1492
  13. #persist
  14. #maxfail 0
  15. #holdoff 20
  16. mtu 1000
  17. persist
  18. maxfail 0
  19. holdoff 0
  20. plugin rp-pppoe.so
  21. nic-enp0s25
  22. usepeerdns
  23. user "××××××××××"

之后保存。

然后

  1. $ sudo gedit /etc/ppp/options

找到以下两个参数位置,并更改数值

  1. lcp-echo-interval 10
  2. lcp-echo-failure 10

保存。

最后重启一下拨号连接就可以了

  1. $ sudo poff dsl-provider
  2. $ sudo pon dsl-provider

测试了一下,没有问题了(重启大概需要10s左右时间)

  1. leo@TP-L440:~$ ping www.baidu.com
  2. PING www.a.shifen.com (220.181.111.188) 56(84) bytes of data.
  3. 64 bytes from 220.181.111.188: icmp_seq=1 ttl=50 time=21.2 ms
  4. 64 bytes from 220.181.111.188: icmp_seq=2 ttl=50 time=21.2 ms
  5. 64 bytes from 220.181.111.188: icmp_seq=3 ttl=50 time=21.2 ms
  6. 64 bytes from 220.181.111.188: icmp_seq=4 ttl=50 time=21.2 ms
  7. 64 bytes from 220.181.111.188: icmp_seq=5 ttl=50 time=21.2 ms
  8. 64 bytes from 220.181.111.188: icmp_seq=6 ttl=50 time=21.3 ms
  9. 64 bytes from 220.181.111.188: icmp_seq=7 ttl=50 time=21.2 ms
  10. 64 bytes from 220.181.111.188: icmp_seq=8 ttl=50 time=21.1 ms
  11. 64 bytes from 220.181.111.188: icmp_seq=9 ttl=50 time=21.2 ms

 

  • 7
    点赞
  • 23
    收藏
    觉得还不错? 一键收藏
  • 6
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值