热门标签 | HotTags
当前位置:  开发笔记 > 运维 > 正文

虚拟机debian网不通

虚拟机debian网不通--Linux发行版技术-Debian信息,下面是详情阅读。
懒得装linux,把别的电脑上的虚拟机做的linux硬盘文件拷到自己电脑上使用,却发现无法联网。

debian:~# ifconfig
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:66 errors:0 dropped:0 overruns:0 frame:0
TX packets:66 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:5104 (4.9 KiB) TX bytes:5104 (4.9 KiB)

没有了eth0接口,查看/etc/network/interfaces

debian:~# 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
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.190
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
gateway 192.168.0.1
# dns-* options are implemented by the resolvconf package, if installed
dns-nameservers 61.128.114.133 61.128.114.166

有eth0的配置,再次ifconfig -a 加-a可以查看所有的接口,不加参数只能查看活动接口。

发现有eth1,eth0没了,这应该是我的虚拟机把网卡认成了eth1,而原来的虚拟机把网卡作为eth0的,导致没有eth1的配置,无法联网,
于是修改/etc/network/interfaces把eth1换成eth1,ifup eth1,还是不行,/etc/init.d/networking restart也不行,reboot,呵呵好了。
推荐阅读
author-avatar
D调肥仔
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有