標籤:enabled 虛擬機器 service 防火牆 status
1、設定虛擬機器的網路是橋接模式
650) this.width=650;" title="1.png" src="https://s5.51cto.com/wyfs02/M01/8E/51/wKioL1i9N82SgJpFAADLGpdHELA248.png-wh_500x0-wm_3-wmp_4-s_906876357.png" alt="wKioL1i9N82SgJpFAADLGpdHELA248.png-wh_50" />
2.關閉防火牆 (為防火牆關閉狀態)
看防火牆規則的設定 iptables -L
在此說一下關於啟動和關閉防火牆的命令:
1) 重啟後生效 開啟: chkconfig iptables on 關閉: chkconfig iptables off
2) 即時生效,重啟後失效 開啟: service iptables start 關閉: service iptables stop
650) this.width=650;" title="3.png" src="https://s5.51cto.com/wyfs02/M02/8E/51/wKioL1i9OS-yvBHUAAA0sxKbrUc575.png-wh_500x0-wm_3-wmp_4-s_3274002488.png" alt="wKioL1i9OS-yvBHUAAA0sxKbrUc575.png-wh_50" />
3.關閉selinux(如果SELinux status參數為enabled即為開啟狀態)
修改/etc/selinux/config 檔案
將SELINUX=enforcing改為SELINUX=disabled
重啟機器即可
650) this.width=650;" title="2.png" src="https://s1.51cto.com/wyfs02/M02/8E/51/wKioL1i9ODmTrgOdAAAWG3MCGJA044.png-wh_500x0-wm_3-wmp_4-s_1709819781.png" alt="wKioL1i9ODmTrgOdAAAWG3MCGJA044.png-wh_50" />
通過以上配置可以在物理機訪問虛擬裡面配置的網站(該虛擬機器已配啟動tomcat服務)
650) this.width=650;" title="4.png" src="https://s4.51cto.com/wyfs02/M01/8E/51/wKioL1i9Ol3gNt4YAABh5ZOWY_U297.png-wh_500x0-wm_3-wmp_4-s_1557792950.png" alt="wKioL1i9Ol3gNt4YAABh5ZOWY_U297.png-wh_50" />
物理機可以訪問虛擬機器裡面搭建的網站