配置静态ip
vi /etc/sysconfig/network-scripts/ifcfg-ens32
service network restart
配置阿里云源
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
yum makecache
拨号配置
yum install rp-pppoe -y
yum erase NetworkManager
pppoe-setup
enp3s0
定时拨号
crontab -e
adsl 15min
00,15,30,45 * * * * (/sbin/ifdown ppp0 && sleep 5s && /sbin/ifup ppp0)
curl http://2017.ip138.com/ic.asp
注意关闭本地ip联网,并使配置为高匿代理
配置代理 # squid为缓存代理,改为使用tinyproxy
yum update # 更新,不可中断,中断可能导致yum故障,暂时只能重装系统
yum clean all # 清除yum缓存,用于使用yum安装找不到包的时候
rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm
yum update
yum install inyproxy # 失败跟上面无关
yum -y install squid # 安装这个代理,tinyproxy安装不了
chkconfig --level 35 squid on # 设置开机启动
vi /etc/squid/squid.conf # 修改配置文件
改以下内容
http_access allow !Safe_ports #deny改成allow
http_access allow CONNECT !SSL_ports #deny改成allow
http_access allow all #deny改成allow
sudo service squid start # 启动
修改tinyproxy的配置文件
vim /etc/tinyproxy/tinyproxy.conf # 修改配置文件
关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动
firewall-cmd --state #查看默认防火墙状态(关闭后显示notrunning,开启后显示running)
配置 静态IP:
vm /etc/sysconfig/network-scripts/ifcfg-ens33
]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
HWADDR="00:15:5D:07:F1:02"
TYPE="Ethernet"
BOOTPROTO="static" #dhcp改为static
DEFROUTE="yes"
PEERDNS="yes"
PEERROUTES="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
IPV6_FAILURE_FATAL="no"
NAME="eth0"
UUID="bb3a302d-dc46-461a-881e-d46cafd0eb71"
ONBOOT="yes" #开机启用本配置
IPADDR=192.168.7.106 #静态IP
GATEWAY=192.168.7.1 #默认网关
NETMASK=255.255.255.0 #子网掩码
DNS1=223.5.5.5 #DNS 配置 必须配未dns服务器,不可陪为网关
重启网卡