执行命令:
curl http://10.200.0.14:8000/portal.cgi -X POST -d 'username=lishuai&password=test@cetc38&language=0&submit=submit'
以便访问外网
执行命令:
ping www.baidu.com
报错:
name or service not know
首先,添加dns服务器:
vi /etc/resolv.conf
在文件中添加如下两行:
nameserver 8.8.8.8 nameserver 8.8.4.4
仍然不行!
打算进行网络配置,首先查看当前网络设置信息:
ifconfig
返回信息:
ifconfig: command not found
打算安装ifconfig:
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
https://www.cnblogs.com/areyouready/p/8909665.html
https://www.cnblogs.com/mafeng/p/10689847.html
http://mirrors.163.com/centos/7/os/x86_64/Packages/