虚拟机新装的系统怎么都拼不能,ifconfig,看到如下信息:
eth1 Link encap:Ethernet HWaddr 00:0C:29:A9:22:9D
inet addr:192.168.1.108 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fea9:229d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:313 errors:0 dropped:0 overruns:0 frame:0
TX packets:182 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:67356 (65.7 KiB) TX bytes:26612 (25.9 KiB)
Interrupt:19 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:1788 errors:0 dropped:0 overruns:0 frame:0
TX packets:1788 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:89560 (87.4 KiB) TX bytes:89560 (87.4 KiB)
坑,记得先前用的是eth0,在网上查了下记录网卡设备的信息,
/etc/udev/rules.d/70-persistent-net.rules
这个系统是手动复制的,怀疑是牛气捉天的虚拟机造成的,在系统启动的时候他提示我是复制还是XXX,不记得最,百度吧.1如何改成0.注释原来的
最后执行:
设置IP:
ifconfig eth0 192.168.112.229 netmask255.255.255.0
设置网关:
route add default gw 192.168.112.1