zoukankan      html  css  js  c++  java
  • Ubuntu16.04网络不能访问解决办法

     

    问题:

    系统重启后,网络不能正常使用,加载网络配置失败,且重启网络时也提示错误。

    解决方法:

    在定位的过程中发现是配置中的网络设备号与实际设备号不符。

    1、查看网络配置中的配备号:

    vi /etc/network/interfaces

    # This file describes the network interfaces available on your system

    # and how to activate them. For more information, see interfaces(5).

    source /etc/network/interfaces.d/*

    # The loopback network interface

    auto lo

    iface lo inet loopback

    # The primary network interface

    auto enx000ec6d35ea9

    iface enx000ec6d35ea9 inet dhcp

    2、在查看实际的设备号:

    cat /proc/net/dev

    Inter-|   Receive                                                |  Transmit

     face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed

    wlp3s0:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

    enx000ec6d35ea9: 2009002   11002    0    0    0     0          0         0 28508118   20031    0    0    0     0       0          0

        lo: 70781548   42425    0    0    0     0          0         0 70781548   42425    0    0    0     0       0          0

    enp0s31f6:       0       0    0    0    0     0          0         0        0       0    0    0    0     0       0          0

    3、进行比对

    将配置中的设备号与实际设备号对比,如果没有则在配置中加入设备号记录。

    比如举例中我的网卡设备号为“enx000ec6d35ea9”,无线网卡的设备号为“wlp3s0”。

    4、配置无线网卡

    vi /etc/network/interfaces

    #自动获取IP方式:

    auto wlan0

    iface wlan0 inet dhcp

    wpa-ssid xxxxxx

    wpa-psk yyyyyy

    #配置静态IP方式

    auto wlan0

    iface wlan0 inet static

    address 192.168.0.150

    netmask 255.255.255.0

    gateway 192.168.0.1

    dns-nameservers 192.168.0.1 xxx.xxx.xxx.xxx

    wpa-ssid xxxxxx

    wpa-psk yyyyyyy

     

     

     

     

  • 相关阅读:
    NDOC中文支持及入门用法
    网页代码常用小技巧
    SOCKET通讯点滴
    自动备份程序目录
    MySql.Data.dll Microsoft.Web.UI.WebControls.dll下载
    c#:获取IE地址栏中的URL
    比较好的单例登录模式(参考网友)
    FreeTextBox使用详解
    2005自定义控件显示基准线
    连接字符串大全
  • 原文地址:https://www.cnblogs.com/gongxr/p/10452083.html
Copyright © 2011-2022 走看看