Ubuntu16.04上拨号上网+有线连接频繁断网问题

时间:2024-03-14 13:14:27

今天在用Ubuntu16.04进行拨号上网的过程中出现了问题,因为它和之前

目录


  • Ubuntu16.04进行拨号上网问题

  1. 首先在终端进行输入:
    sudo pppoeconf

    之后在页面会出现一个界面,一直选择yes(Enter键)就可以,之后输入你的账号和密码,后面再一直选择yes(Enter键)就可以了。如图所示:Ubuntu16.04上拨号上网+有线连接频繁断网问题

  2. 下次再次进入的时候,如果需要上网,则在终端输入:
    sudo pon dsl-provider

     

  3. 如果需要进行断网操作,则在终端输入:

    sudo poff dsl-provider

    就是这样简单几步,Ubuntu16.04上进行拨号上网的问题就迎刃而解了!

  • Ubuntu16.04有线连接频繁断网问题

  1. 有线连接号可以进行上网后,我在进行keras-gpu的安装过程中,几次都是因为网络连接异常而中止,这就出现了时断时续的问题,于是我在终端进行测试,发现网络连接果然是断断续续的。如下所示
    ping www.baidu.com
    PING www.a.shifen.com (119.75.217.109) 56(84) bytes of data.
    64 bytes from 119.75.217.109: icmp_seq=1 ttl=51 time=29.7 ms
    64 bytes from 119.75.217.109: icmp_seq=2 ttl=51 time=29.5 ms
    64 bytes from 119.75.217.109: icmp_seq=3 ttl=51 time=29.9 ms
    64 bytes from 119.75.217.109: icmp_seq=4 ttl=51 time=30.7 ms
    64 bytes from 119.75.217.109: icmp_seq=5 ttl=51 time=29.8 ms
    ping: sendmsg: Network is unreachable
    ping: sendmsg: Network is unreachable
    ping: sendmsg: Network is unreachable
    64 bytes from 119.75.217.26: icmp_seq=10 ttl=51 time=30.0 ms
    64 bytes from 119.75.217.26: icmp_seq=11 ttl=51 time=30.4 ms
    64 bytes from 119.75.217.26: icmp_seq=12 ttl=51 time=29.9 ms
    64 bytes from 119.75.217.26: icmp_seq=13 ttl=51 time=29.8 ms
    64 bytes from 119.75.217.26: icmp_seq=14 ttl=51 time=29.9 ms
    64 bytes from 119.75.217.26: icmp_seq=15 ttl=51 time=29.8 ms
    64 bytes from 119.75.217.26: icmp_seq=16 ttl=51 time=29.8 ms
    64 bytes from 119.75.217.26: icmp_seq=17 ttl=51 time=29.8 ms
    ping: sendmsg: Network is unreachable
    ping: sendmsg: Network is unreachable
    ping: sendmsg: Network is unreachable
    ping: sendmsg: Network is unreachable
  2. 针对这个问题,我们需要进行配置文件的修改,在终端输入:
    sudo gedit /etc/ppp/peers/dsl-provider

     

  3. 在配置文件中按照如下标示进行添加文件:(按照如下红色位置添加相应的红色标记内容,并进行保存退出

    # 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-enp2s0
    user "[email protected]"
    usepeerdns

  4. 然后在终端输入以下命令:
    udo gedit /etc/ppp/options

    找到以下两个参数位置,并对其进行如下所示的数值修改:

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

    保存后,退出即可。

  5. 重启系统,再按照上面所示进行拨号和断开操作进行就可以了。
    断开:
    sudo poff dsl-provider
    拨号:
    sudo pon dsl-provider

     

  6. 再次进行网络测试,我们等待了30秒,发现网络正常,没有出现断断续续的问题,上诉问题得到解决。

PS:在问题出现时寻找答案,同时也是增长知识,当你没有遇到问题和遇到问题时看同一篇文章也可能时两种感受。所以,在学习中汲取,在学习中进步!