歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> 重裝Vmware造成Ubuntu網絡問題

重裝Vmware造成Ubuntu網絡問題

日期:2017/2/28 16:59:20   编辑:Linux教程

今天重裝了vmware後,再次使用原來的Ubuntu7.10文件,找不到網絡連接。

web@Ubuntu8:~$ ifconfig
eth1 Link encap:Ethernet HWaddr 00:0C:29:ED:F3:C2
inet addr:0 Bcast:0 Mask:0
Interrupt:16 Base address:0x2000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

sudo vim /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet dhcp
原來是新舊vmware的網卡不一樣,將eth0改為eth1,重啟網絡
sudo /etc/init.d/networking restart
一切OK了

順便講一下/etc/network/interfaces
如果是配置eth為靜態IP
(比如192.168.1.1)並且指定網關(如192.168.1.254),那麼如此配置:
auth eth0
iface eth0 inet staticaddress 192.168.1.1
netmask 255.255.255.0
gateway 192.168.1.254
如果是手動指定IP並且還需要訪問互聯網,比如wget下載,那麼還需要設置DNS:
$sudo pico /etc/resolv.conf向這裡添加配置內容:nameserver xxx.xxx.xxx.xxx保存即可。

Copyright © Linux教程網 All Rights Reserved