A-A+

Ubuntu添加网卡设备

2017年02月06日 运维 暂无评论 阅读 359 次

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++程序员之家

标签:

给我留言

Copyright © C/C++程序员之家 保留所有权利.   Theme  Ality 浙ICP备15011757号-3

用户登录