标签:
主机上安装了个VM centeros
首先通过 终端:ifconfig eth0 查看虚拟机的Ip地址
这样就能在主机上通过浏览器http://192.168.150.128/a.php 访问虚拟机的web服务了
telnet 192.168.150.128 80 失败判断为80端口未开放
修改防火墙规则
[root@jiangbo ~]# /sbin/iptables -I INPUT -p tcp --dport 80 -j ACCEPT [root@jiangbo ~]# /etc/rc.d/init.d/iptables save iptables:将防火墙规则保存到 /etc/sysconfig/iptables: [确定] [root@jiangbo ~]# /etc/init.d/iptables restart iptables:将链设置为政策 ACCEPT:filter [确定] iptables:清除防火墙规则: [确定] iptables:正在卸载模块: [确定] iptables:应用防火墙规则: [确定] [root@jiangbo ~]# ifconfig eth0 eth0 Link encap:Ethernet HWaddr 00:0C:29:3A:B6:53 inet addr:192.168.150.128 Bcast:192.168.150.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:fe3a:b653/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:310837 errors:0 dropped:0 overruns:0 frame:0 TX packets:112606 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:389046032 (371.0 MiB) TX bytes:9175743 (8.7 MiB)
标签:
原文地址:http://www.cnblogs.com/as3lib/p/5662706.html