IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    Ubuntu添加网卡设备

    admin发表于 2017-02-06 06:48:56
    love 0

    ubuntu没有网卡,ubuntu添加网卡,Ubuntu只有io设备,Ubuntu没有网卡设备

    一、列出网卡名,logical name即为要添加的网卡名

    root@ubuntu-2:~# sudo lshw -class network
      *-network               
           description: Ethernet interface
           product: Virtio network device
           vendor: Red Hat, Inc
           physical id: 3
           bus info: pci@0000:00:03.0
           logical name: ens18
           version: 00
           serial: fa:16:3e:aa:ee:d4
           width: 32 bits
           clock: 33MHz
           capabilities: msix bus_master cap_list rom ethernet physical
           configuration: autonegotiation=off broadcast=yes driver=virtio_net driverversion=1.0.0 ip=192.168.56.82 latency=0 link=yes multicast=yes
           resources: irq:10 ioport:c060(size=32) memory:febd1000-febd1fff memory:feb80000-febbffff
    root@ubuntu-2:~#

    二、配置网卡,vi /etc/network/interfaces

    auto ens18
    iface ens18 inet static
    address 10.10.10.50
    netmask 255.255.255.0
    gateway 10.10.10.1

    三、临时配置DNS,重启失效。vi /etc/resolv.conf

    nameserver 8.8.8.8
    nameserver 8.8.4.4

    四、永久配置DNS,永久生效。vi /etc/resolvconf/resolv.conf.d/base

    nameserver 8.8.8.8
    nameserver 8.8.4.4

    五、重启网络

    systemctl restart networking

    Copyright:www.cplusplus.me Share、Open- C/C++程序员之家



沪ICP备19023445号-2号
友情链接