天天看點

主機通路虛拟機中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]#