执行命令: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/