寶塔Linux安裝腳本
yum install -y wget && wget -O install.sh http://download.bt.cn/install/install.sh && sh install.sh
*無法聯網的明顯表現會有:
1、yum install出現 Error: cannot find a valid baseurl or repo:base
2、ping host會提示unknown host
方法一、
1、打開 vi /etc/sysconfig/network-scripts/ifcfg-eth0(每個機子都可能不一樣,但格式會是“ifcfg-eth數字”),把ONBOOT=no,改爲ONBOOT=yes
2、重啓網絡:service network restart
方法二、
1、打開 vi /etc/resolv.conf,增加 nameserver 114.114.114.114 或可訪問的DNS地址。如果192.168.0.1
2、重啓網絡: service network restart
如還是無法訪問外網,可添加永久靜態路由,沒有文件創建一個route-xxxxx(xxxxx爲網卡標識,根據Ifcfg-xxxxx)
其中70是本機IP,1是網址IP
vi /etc/sysconfig/network-scripts/route-ens33
192.168.0.70/24 via 192.168.0.1
0.0.0.0/0 via 192.168.0.1
參考鏈接:https://blog.csdn.net/woailyoo0000/article/details/79506999