- 快速檢查可用的網路卡,由下可見是找不到名為eth的網路
root@lulu:~# ifconfig -a |grep eth
- 使用lshw指令找尋網卡,由下可見,不見得每張網卡都叫eth,目前OS VM使用Alfa Usb無線網卡,名稱為enp0s3
root@lulu:/etc/network# lshw -class network
USB
*-network
description: Ethernet interface
product: 82540EM Gigabit Ethernet Controller
vendor: Intel Corporation
physical id: 3
bus info: pci@0000:00:03.0
logical name: enp0s3
version: 02
serial: 08:00:27:62:75:7a
size: 1Gbit/s
capacity: 1Gbit/s
width: 32 bits
clock: 66MHz
capabilities: pm pcix bus_master cap_list ethernet physical tp 10bt 10bt-fd 100bt 100bt-fd 1000bt-fd autonegotiation
configuration: autonegotiation=on broadcast=yes driver=e1000 driverversion=7.3.21-k8-NAPI duplex=full ip=192.168.1.122 latency=64 link=yes mingnt=255 multicast=yes port=twisted pair speed=1Gbit/s
resources: irq:19 memory:f0000000-f001ffff ioport:d010(size=8)
root@lulu:/etc/network#
- 修改檔案/etc/network/interfaces ,
auto lo
iface lo inet loopback
iface enp0s3 inet static
address 192.168.1.151
netmasks 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
gateway 192.168.1.1
dns-nameservers 168.95.1.1
沒有留言:
張貼留言