vmware虚拟机怎样让linux(centos6.4)桥接上网|本机用putty连接centos通信

kuailexiaochuan 2015-08-16

一、vmware的网卡连接方式选择为桥接(bridged)不要用Nat方法,如下图所示:

vmware虚拟机怎样让linux(centos6.4)桥接上网|本机用putty连接centos通信
连“Replicate physical network connection state”也勾上吧。


二、修改虚拟机centos上的网卡配置    /etc/sysconfig/network-scripts/ifcfg-eth0

[root@localhost tomener]# vim /etc/sysconfig/network-scripts/ifcfg-eth0

EVICE="eth0"

BOOTPROTO="static"

HWADDR="00:0C:29:C0:EB:59"

IPV6INIT="yes"

NM_CONTROLLED="yes"

ONBOOT="no"

TYPE="Ethernet"

UUid="e4671ff5-8fb1-4f5f-9725-e08f0cb293f6"

IPADDR=192.168.1.109

NETMASK=255.255.255.0

GATEWAY=192.168.1.1

DNS1=202.96.128.86

DNS2=202.96.128.166


提示:BOOTPROTO的设置,可以设置为static 或者 dhcp

三、禁止掉SELINUX

[root@localhost tomener]# vim /etc/selinux/config


# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux security policy is enforced.
#     permissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
#SELINUX=enforcing
SELINUX=disabled
# SELINUXTYPE= can take one of these two values:
#     targeted - Targeted processes are protected,
#     mls - Multi Level Security protection.
SELINUXTYPE=targeted


这里是把SELINUX=enforcing 改为 SELINUX=disabled

第四步:重启network
ifup eth0

第五步:ping www.baidu.com

[root@localhost tomener]# ping www.baidu.com
PING www.a.shifen.com (115.239.210.26) 56(84) bytes of data.
64 bytes from 115.239.210.26: icmp_seq=1 ttl=55 time=204 ms
64 bytes from 115.239.210.26: icmp_seq=2 ttl=55 time=119 ms
64 bytes from 115.239.210.26: icmp_seq=3 ttl=55 time=264 ms
64 bytes from 115.239.210.26: icmp_seq=4 ttl=55 time=207 ms
^C


到此,让在vmware虚拟机上的centos上网,并起和本机通信就完成了,

现在你就可以是用putty来连接了你的linux服务器了

如果重启了network还是连接不上,那么先关闭服务器,再启动,不要用重启试试。

有时候开机上不了网,按以下办法试试


vmware虚拟机怎样让linux(centos6.4)桥接上网|本机用putty连接centos通信
 
vmware虚拟机怎样让linux(centos6.4)桥接上网|本机用putty连接centos通信
 

相关推荐

哥哥的CSDN集 / 0评论 2020-01-07