配置靜態(tài)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
注意關(guān)閉本地ip聯(lián)網(wǎng)衡便,并使配置為高匿代理
配置代理 # squid為緩存代理带饱,改為使用tinyproxy
yum update # 更新搜骡,不可中斷,中斷可能導致yum故障龄减,暫時只能重裝系統(tǒng)
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 # 失敗跟上面無關(guān)
yum -y install squid # 安裝這個代理,tinyproxy安裝不了
chkconfig --level 35 squid on # 設(shè)置開機啟動
vi /etc/squid/squid.conf # 修改配置文件
改以下內(nèi)容
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 # 修改配置文件
關(guān)閉防火墻
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall開機啟動
firewall-cmd --state #查看默認防火墻狀態(tài)(關(guān)閉后顯示notrunning粘秆,開啟后顯示running)
配置 靜態(tài)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 #靜態(tài)IP
GATEWAY=192.168.7.1 #默認網(wǎng)關(guān)
NETMASK=255.255.255.0 #子網(wǎng)掩碼
DNS1=223.5.5.5 #DNS 配置 必須配未dns服務(wù)器,不可陪為網(wǎng)關(guān)
重啟網(wǎng)卡