![centos如何才能存取外網](https://img.php.cn/upload/article/000/000/041/5e86dee8891cc608.jpg)
設定centos7.5能夠存取外網的方法:
輸入指令cd /etc/sysconfig/network-scripts,進入網卡設定檔所在路徑下
![1585897232148547.png centos如何才能存取外網](https://img.php.cn/upload/image/109/479/808/1585897232148547.png)
輸入指令 ls -l 可以查看所有的檔案列表,找到ifcfg-ens33設定檔
![1585897248839478.png centos如何才能存取外網](https://img.php.cn/upload/image/385/280/327/1585897248839478.png)
##輸入指令 vi ifcfg -ens33來編輯網卡檔案
![1585897264650234.png centos如何才能存取外網](https://img.php.cn/upload/image/614/311/481/1585897264650234.png)
在ifcfg-ens33設定檔中,增加外網IP,子網路遮罩與閘道的配置,儲存退出
![1585897278195967.png centos如何才能存取外網](https://img.php.cn/upload/image/218/135/106/1585897278195967.png)
#輸入指令 vi /etc/resolv.conf 編輯dns,追加dns位址114.144.114.114,儲存退出
![1585897293392521.png centos如何才能存取外網](https://img.php.cn/upload/image/968/963/322/1585897293392521.png)
執行指令重新啟動網路
systemctl restart network
登入後複製
執行指令 ping 百度域名,如果能ping通,說明網路設定成功
![1585897311803251.png centos如何才能存取外網](https://img.php.cn/upload/image/763/678/911/1585897311803251.png)
相關教學推薦:
centos教學
以上是centos如何才能存取外網的詳細內容。更多資訊請關注PHP中文網其他相關文章!