vmware 网络配置:
主机IP配置:
虚拟机IP配置:
vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE='eth0'
HWADDR='00:0C:29:F7:7D:B0'ONBOOT='yes'
BOOTPROTO='static'
IPADDR='192.168.187.105'
NETMASK='255.255.255.0'
GATEWAY='192.168.187.2'
DNS1='192.168.187.2'
IPV6INIT='no'
TYPE='Ethernet'
配置好后,互相均能ping通,虚拟机能上网:
#查看防火墙状态
service iptables status
#关闭防火墙
service iptables stop
#查看防火墙开机启动状态
chkconfig iptables --list
#关闭防火墙开机启动
chkconfig iptables off
service iptables status
#关闭防火墙
service iptables stop
#查看防火墙开机启动状态
chkconfig iptables --list
#关闭防火墙开机启动
chkconfig iptables off
启动SSH服务:
service sshd start
SSH连接虚拟机: