Ubuntu添加网卡设备
ubuntu没有网卡,ubuntu添加网卡,Ubuntu只有io设备,Ubuntu没有网卡设备
一、列出网卡名,logical name即为要添加的网卡名
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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
1 2 3 4 5 |
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
1 2 |
nameserver 8.8.8.8 nameserver 8.8.4.4 |
四、永久配置DNS,永久生效。vi /etc/resolvconf/resolv.conf.d/base
1 2 |
nameserver 8.8.8.8 nameserver 8.8.4.4 |
五、重启网络
1 |
systemctl restart networking |
Copyright:cpp.cloudcpp.com Share、Open- C/C++程序员之家