物理機可以訪問虛擬機器裡面搭建的網站

來源:互聯網
上載者:User

標籤: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" />

物理機可以訪問虛擬機器裡面搭建的網站

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.