執行命令:html
curl http://10.200.0.14:8000/portal.cgi -X POST -d 'username=lishuai&password=test@cetc38&language=0&submit=submit'
以便訪問外網linux
執行命令:git
ping www.baidu.com
報錯:centos
name or service not know
首先,添加dns服務器:緩存
vi /etc/resolv.conf
在文件中添加以下兩行:服務器
nameserver 8.8.8.8 nameserver 8.8.4.4
仍然不行!網絡
打算進行網絡配置,首先查看當前網絡設置信息:curl
ifconfig
返回信息:url
ifconfig: command not found
打算安裝ifconfig:spa
rpm install ifconfig
返回信息:
Cannot find a valid baseurl for repo: poptop-stable/7
打算從新配置源:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
返回信息:
wget: command not found
只能手動下載rpm包並安裝,首先查看當前CentOS的版本:
rpm -q centos-release
返回信息:
centos-release-7-3.1611.el7.centos.x86_64
打開網址:http://mirrors.163.com/centos/7/os/x86_64/Packages/
下載文件:
net-tools-2.0-0.24.20131004git.el7.x86_64.rpm
wget-1.14-18.el7.x86_64.rpm
手動安裝:
rpm -ivh wget-1.14-18.el7.x86_64.rpm rpm -ivh net-tools-2.0-0.24.20131004git.el7.x86_64.rpm
下載配置源的文件:
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
把原有的源配置文件改成.repo.bak,備份放入文件夾bak
清除源緩存並從新創建:
yum clean all yum makecache
ping如今也能正常使用
引用:
https://www.jianshu.com/p/5c4b5a20b821
http://www.javashuo.com/article/p-tzmkwpxm-gk.html
http://www.javashuo.com/article/p-uvffsdpt-gb.html
http://mirrors.163.com/centos/7/os/x86_64/Packages/