#網路設定 ##server端設定 ![](https://i.imgur.com/LpvkQwT.png) ![](https://i.imgur.com/FfjOgZi.png) 點選剛建立的網路內容,將 IPV4 的 IP 改為: 172.24.10.1 ![](https://i.imgur.com/Y7uO7o7.png) 啟用伺服器 ![](https://i.imgur.com/3SxjzYn.png) ![](https://i.imgur.com/N5QwuFX.png) ![](https://i.imgur.com/SO1xsJb.png) ![](https://i.imgur.com/XEmuwpW.png) ![](https://i.imgur.com/rSR0Jn3.png) ![](https://i.imgur.com/FcmI5de.png) ![](https://i.imgur.com/6I5Lfg1.png) 進到虛擬機內先用 ifconfig 查看網路是不是有兩張卡,並確認網卡名稱 (通常對外是 192,對內有改過會是 172) 設定網卡 IP 的內容 Vim /etc/sysconfig/network-scripts/ifcfg-enp0s3 (設定對外的) ![](https://i.imgur.com/ongWlTK.png) Vim /etc/sysconfig/network-scripts/ifcfg-enp0s8 (設定對內的) 如果沒有的話就複製 enp0s3 的內容過去 IPADDR=172.24.10.1 GATEWAY=172.24.10.1 ![](https://i.imgur.com/2L4x7Qk.png) 好了之後先 Reboot 一次 重開機完 用 Route -n 查看 gateway 有沒有設好 Ipforward ![](https://i.imgur.com/pCiCPMo.png) ##Client端設定 主要是跟 SERVER 的對內網卡設定一樣,主要是差在只有用一張僅限主機的網卡 IP 的話就設成 172.24.10.XX 只要是同一個網域內就好(254 以內) GATEWAY 設為一樣的 172.24.10.1 就好