天天看点

主机访问虚拟机中linux上的web服务

环境:主机windows xp 虚拟机centos 6.4

[root@localhost /]# iptables -I INPUT -p tcp --dport 80 -j ACCEPT

[root@localhost /]# /etc/rc.d/init.d/iptables save

iptables: Saving firewall rules to /etc/sysconfig/iptables:[  OK  ]

[root@localhost /]# cd /etc

[root@localhost etc]# cd init.d

[root@localhost init.d]# ls

auditd            crond      halt       iptables  keepalived  lvm2-lvmetad  netconsole  network  rdisc        rsyslog  saslauthd  sshd

blk-availability  functions  ip6tables  jexec     killall     lvm2-monitor  netfs       postfix  restorecond  sandbox  single     udev-post

[root@localhost init.d]# /etc/init.d/iptables restart

iptables: Flushing firewall rules:                         [  OK  ]

iptables: Setting chains to policy ACCEPT: filter          [  OK  ]

iptables: Unloading modules:                               [  OK  ]

iptables: Applying firewall rules:                         [  OK  ]

[root@localhost init.d]#