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

最近从Ubuntu14.04换到了16.04,学校又从锐捷校园网换成了深澜,于是上网时候遇到了一些小问题。
首先解决在Ubuntu下拨号上网

首先终端输入

    $ sudo pppoeconf

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

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

一路yes就搞定了。

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

    $ sudo pon dsl-provider

如果要切断网络

    $ sudo poff dsl-provider

 
解决频繁断网的问题

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

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

 

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

终端输入

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

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

    # Minimalistic default options file for DSL/PPPoE connections
    noipdefault
    defaultroute
    replacedefaultroute
    hide-password
    #lcp-echo-interval 30
    #lcp-echo-failure 4
    lcp-echo-interval 10
    lcp-echo-failure 10
    noauth
    persist
    #mtu 1492
    #persist
    #maxfail 0
    #holdoff 20
    mtu 1000
    persist
    maxfail 0
    holdoff 0
    plugin rp-pppoe.so
    nic-enp0s25
    usepeerdns
    user "××××××××××"

之后保存。

然后

    $ sudo gedit /etc/ppp/options

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

    lcp-echo-interval 10
    lcp-echo-failure 10

保存。

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

    $ sudo poff dsl-provider
    $ sudo pon dsl-provider

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

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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值