码迷,mamicode.com
首页 > 其他好文 > 详细

虚拟机桥接方式手动修改ip地址

时间:2015-08-10 18:17:52      阅读:120      评论:0      收藏:0      [点我收藏+]

标签:

1、System - Administration - Network Tools

2、Devices下选择Ethernet interface(eth0),即第0块网卡

3、选择Configure

4、选中Auto eth0 - edit - ipv4 setting:

    address:和宿主机器同一网段,避免ip冲突,例如:192.168.31.247

    netmask:255.255.255.0

    Gateway:和宿主机器同一网关,例如:192.168.31.1

    DNS Servers:和宿主机器相同,例如:192.168.31.1

5、重启网络服务

    Ubuntu:sudo /etc/init.d/networking restart

    other:service network restart

    如果上面两条命令不起作用,就重启系统试一试吧

方式二:修改interfaces文件,重启系统(推荐,简单,易用)

vi /etc/network/interfaces

auto lo
iface lo inet loopback

iface eth0 inet static

address 192.168.31.247

netmask 255.255.255.0

gateway 192.168.31.1

auto eth0

如果还是上不了网,注意查看宿主机器的相关服务是否开启

如果ping不通,注意查看宿主机器和虚拟机系统的防火墙是否关闭

关闭防火墙:

centos
 chkconfig iptables off  不重启不会生效:
 service iptables stop  不需要重启

ubuntu
 ufw disable    需要重启系统
 sudo iptables -F
 sudo ufw status

虚拟机桥接方式手动修改ip地址

标签:

原文地址:http://my.oschina.net/sniperLi/blog/490240

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!