码迷,mamicode.com
首页 > Web开发 > 详细

CENTOS7配多IP出口socks5和http代理

时间:2020-07-01 20:32:05      阅读:238      评论:0      收藏:0      [点我收藏+]

标签:chmod   tput   pos   source   pen   bind   ret   deny   ice   

#!/bin/bash
yum -y install epel-release
yum -y update
yum -y remove firewalld
yum -y install iptables iptables-services
yum -y install gcc vim wget make
##配置selinux及主机名
hostnamectl set-hostname ss5_server_X
setenforce 0
sed -i "s/SELINUX=enforcing/SELINUX=disabled/" /etc/selinux/config
##安装http(s)代理,用户名密码认证HTTP代理
yum -y install tinyproxy squid 
yum -y install pam-devel openssl-devel openldap-devel
##安装配置ss5代理
##wget https://nchc.dl.sourceforge.net/project/ss5/ss5/3.8.9-8/ss5-3.8.9-8.tar.gz
wget http://111.231.77.152:9999/ss5-3.8.9-8.tar.gz
tar vzxf  ss5-3.8.9-8.tar.gz
cp -r ss5-3.8.9 ss5-3.8.9-modify
cd ss5-3.8.9
./configure
make
make install
sed -i "s/^#auth /auth /" /etc/opt/ss5/ss5.conf
sed -i "s/^#permit /permit /" /etc/opt/ss5/ss5.conf
##安装radius认证s5代理
cd ..
cd ss5-3.8.9-modify
sed -i "s/ss5.conf/ss5radius.conf/" include/config.h
sed -i "s/ss5.pid/ss5radius.pid/" include/config.h
sed -i "s/ss5.log/ss5radius.log/" include/config.h

sed -i "s/ss5.conf/ss5radius.conf/" include/config.h.in
sed -i "s/ss5.pid/ss5radius.pid/" include/config.h.in
sed -i "s/ss5.log/ss5radius.log/" include/config.h.in
make clean
./configure
make
cp src/ss5 /usr/sbin/ss5radius
cat >/etc/opt/ss5/ss5radius.conf<<EOF
set SS5_RADIUS_AUTH
set SS5_AUTHCACHE
set SS5_AUTHCACHEAGE 600
radius_ip 192.168.168.254 
radius_secret 123456
auth    0.0.0.0/0               -              u 
permit -        0.0.0.0/0       -       0.0.0.0/0       -       -       -       -	-
EOF





##添加用户
for((i=6001;i<=6200;i++));do /usr/sbin/useradd socks$i -u $i -M -s /sbin/nologin ;done 


##配置网卡IP
cat>/etc/sysconfig/network-scripts/ifcfg-ens33<<EOF
TYPE=Ethernet
BOOTPROTO=static
PEERROUTES=YES
DEFROUTE=yes
NAME=ens33
DEVICE=ens33
ONBOOT=yes
DEFROUTE=YES
DEFDNS=YES
DNS1=114.114.114.114
NETMASK=255.255.255.0
GATEWAY0=192.168.100.254
IPADDR0=192.168.100.253
IPADDR1=192.168.100.1
IPADDR2=192.168.100.2
IPADDR3=192.168.100.3
IPADDR4=192.168.100.4
IPADDR5=192.168.100.5
IPADDR6=192.168.100.6
IPADDR7=192.168.100.7
IPADDR8=192.168.100.8
IPADDR9=192.168.100.9
IPADDR10=192.168.100.10
IPADDR11=192.168.100.11
IPADDR12=192.168.100.12
IPADDR13=192.168.100.13
IPADDR14=192.168.100.14
IPADDR15=192.168.100.15
IPADDR16=192.168.100.16
IPADDR17=192.168.100.17
IPADDR18=192.168.100.18
IPADDR19=192.168.100.19
IPADDR20=192.168.100.20
IPADDR21=192.168.100.21
IPADDR22=192.168.100.22
IPADDR23=192.168.100.23
IPADDR24=192.168.100.24
IPADDR25=192.168.100.25
IPADDR26=192.168.100.26
IPADDR27=192.168.100.27
IPADDR28=192.168.100.28
IPADDR29=192.168.100.29
IPADDR30=192.168.100.30
IPADDR31=192.168.100.31
IPADDR32=192.168.100.32
IPADDR33=192.168.100.33
IPADDR34=192.168.100.34
IPADDR35=192.168.100.35
IPADDR36=192.168.100.36
IPADDR37=192.168.100.37
IPADDR38=192.168.100.38
IPADDR39=192.168.100.39
IPADDR40=192.168.100.40
IPADDR41=192.168.100.41
IPADDR42=192.168.100.42
IPADDR43=192.168.100.43
IPADDR44=192.168.100.44
IPADDR45=192.168.100.45
IPADDR46=192.168.100.46
IPADDR47=192.168.100.47
IPADDR48=192.168.100.48
IPADDR49=192.168.100.49
IPADDR50=192.168.100.50
IPADDR51=192.168.100.51
IPADDR52=192.168.100.52
IPADDR53=192.168.100.53
IPADDR54=192.168.100.54
IPADDR55=192.168.100.55
IPADDR56=192.168.100.56
IPADDR57=192.168.100.57
IPADDR58=192.168.100.58
IPADDR59=192.168.100.59
IPADDR60=192.168.100.60
IPADDR61=192.168.100.61
IPADDR62=192.168.100.62
IPADDR63=192.168.100.63
IPADDR64=192.168.100.64
IPADDR65=192.168.100.65
IPADDR66=192.168.100.66
IPADDR67=192.168.100.67
IPADDR68=192.168.100.68
IPADDR69=192.168.100.69
IPADDR70=192.168.100.70
IPADDR71=192.168.100.71
IPADDR72=192.168.100.72
IPADDR73=192.168.100.73
IPADDR74=192.168.100.74
IPADDR75=192.168.100.75
IPADDR76=192.168.100.76
IPADDR77=192.168.100.77
IPADDR78=192.168.100.78
IPADDR79=192.168.100.79
IPADDR80=192.168.100.80
IPADDR81=192.168.100.81
IPADDR82=192.168.100.82
IPADDR83=192.168.100.83
IPADDR84=192.168.100.84
IPADDR85=192.168.100.85
IPADDR86=192.168.100.86
IPADDR87=192.168.100.87
IPADDR88=192.168.100.88
IPADDR89=192.168.100.89
IPADDR90=192.168.100.90
IPADDR91=192.168.100.91
IPADDR92=192.168.100.92
IPADDR93=192.168.100.93
IPADDR94=192.168.100.94
IPADDR95=192.168.100.95
IPADDR96=192.168.100.96
IPADDR97=192.168.100.97
IPADDR98=192.168.100.98
IPADDR99=192.168.100.99
IPADDR100=192.168.100.100
IPADDR101=192.168.100.101
IPADDR102=192.168.100.102
IPADDR103=192.168.100.103
IPADDR104=192.168.100.104
IPADDR105=192.168.100.105
IPADDR106=192.168.100.106
IPADDR107=192.168.100.107
IPADDR108=192.168.100.108
IPADDR109=192.168.100.109
IPADDR110=192.168.100.110
IPADDR111=192.168.100.111
IPADDR112=192.168.100.112
IPADDR113=192.168.100.113
IPADDR114=192.168.100.114
IPADDR115=192.168.100.115
IPADDR116=192.168.100.116
IPADDR117=192.168.100.117
IPADDR118=192.168.100.118
IPADDR119=192.168.100.119
IPADDR120=192.168.100.120
IPADDR121=192.168.100.121
IPADDR122=192.168.100.122
IPADDR123=192.168.100.123
IPADDR124=192.168.100.124
IPADDR125=192.168.100.125
IPADDR126=192.168.100.126
IPADDR127=192.168.100.127
IPADDR128=192.168.100.128
IPADDR129=192.168.100.129
IPADDR130=192.168.100.130
IPADDR131=192.168.100.131
IPADDR132=192.168.100.132
IPADDR133=192.168.100.133
IPADDR134=192.168.100.134
IPADDR135=192.168.100.135
IPADDR136=192.168.100.136
IPADDR137=192.168.100.137
IPADDR138=192.168.100.138
IPADDR139=192.168.100.139
IPADDR140=192.168.100.140
IPADDR141=192.168.100.141
IPADDR142=192.168.100.142
IPADDR143=192.168.100.143
IPADDR144=192.168.100.144
IPADDR145=192.168.100.145
IPADDR146=192.168.100.146
IPADDR147=192.168.100.147
IPADDR148=192.168.100.148
IPADDR149=192.168.100.149
IPADDR150=192.168.100.150
IPADDR151=192.168.100.151
IPADDR152=192.168.100.152
IPADDR153=192.168.100.153
IPADDR154=192.168.100.154
IPADDR155=192.168.100.155
IPADDR156=192.168.100.156
IPADDR157=192.168.100.157
IPADDR158=192.168.100.158
IPADDR159=192.168.100.159
IPADDR160=192.168.100.160
IPADDR161=192.168.100.161
IPADDR162=192.168.100.162
IPADDR163=192.168.100.163
IPADDR164=192.168.100.164
IPADDR165=192.168.100.165
IPADDR166=192.168.100.166
IPADDR167=192.168.100.167
IPADDR168=192.168.100.168
IPADDR169=192.168.100.169
IPADDR170=192.168.100.170
IPADDR171=192.168.100.171
IPADDR172=192.168.100.172
IPADDR173=192.168.100.173
IPADDR174=192.168.100.174
IPADDR175=192.168.100.175
IPADDR176=192.168.100.176
IPADDR177=192.168.100.177
IPADDR178=192.168.100.178
IPADDR179=192.168.100.179
IPADDR180=192.168.100.180
IPADDR181=192.168.100.181
IPADDR182=192.168.100.182
IPADDR183=192.168.100.183
IPADDR184=192.168.100.184
IPADDR185=192.168.100.185
IPADDR186=192.168.100.186
IPADDR187=192.168.100.187
IPADDR188=192.168.100.188
IPADDR189=192.168.100.189
IPADDR190=192.168.100.190
IPADDR191=192.168.100.191
IPADDR192=192.168.100.192
IPADDR193=192.168.100.193
IPADDR194=192.168.100.194
IPADDR195=192.168.100.195
IPADDR196=192.168.100.196
IPADDR197=192.168.100.197
IPADDR198=192.168.100.198
IPADDR199=192.168.100.199
IPADDR200=192.168.100.200
EOF
##for((i=1;i<=200;i++));do /sbin/ip address add 192.168.100.$i/24 dev eth0;done 
##配置iptables
systemctl enable iptables
iptables -F
iptables -t mangle -F OUTPUT 
for ((i=6001; i <= 6200 ; i++)) 
do 
iptables -t mangle -A OUTPUT -m owner --uid-owner $i -j MARK --set-mark $i
done 
iptables -t nat -F POSTROUTING
for ((i=6001; i<=6200 ; i++)) 
do
iptables -t nat -A POSTROUTING -m mark --mark $i -j SNAT --to 192.168.100.$(($i-6000))
done 
iptables-save >/etc/sysconfig/iptables
##配置免认证HTTP代理
sed -i "s/^Allow 127.0.0.1/#Allow 127.0.0.1 /" /etc/tinyproxy/tinyproxy.conf 
sed -i "s/^#BindSame yes/BindSame yes /" /etc/tinyproxy/tinyproxy.conf 
systemctl enable tinyproxy
service tinyproxy start
##配置用户名密码认证HTTP代理
systemctl enable squid
echo "server 192.168.168.254" >/etc/squid/squid_radius.conf
echo "secret 123456">>/etc/squid/squid_radius.conf
cat>/etc/squid/squid.conf<<EOF
http_port 3128
auth_param basic program /usr/lib64/squid/basic_radius_auth  -f /etc/squid/squid                                                                                        _radius.conf
auth_param basic children 5
auth_param basic realm Web-Proxy
auth_param basic credentialsttl 5 minute
auth_param basic casesensitive off
acl radius-auth proxy_auth REQUIRED

acl ip_1 myip 192.168.100.1
acl ip_2 myip 192.168.100.2
acl ip_3 myip 192.168.100.3
acl ip_4 myip 192.168.100.4
acl ip_5 myip 192.168.100.5
acl ip_6 myip 192.168.100.6
acl ip_7 myip 192.168.100.7
acl ip_8 myip 192.168.100.8
acl ip_9 myip 192.168.100.9
acl ip_10 myip 192.168.100.10
acl ip_11 myip 192.168.100.11
acl ip_12 myip 192.168.100.12
acl ip_13 myip 192.168.100.13
acl ip_14 myip 192.168.100.14
acl ip_15 myip 192.168.100.15
acl ip_16 myip 192.168.100.16
acl ip_17 myip 192.168.100.17
acl ip_18 myip 192.168.100.18
acl ip_19 myip 192.168.100.19
acl ip_20 myip 192.168.100.20
acl ip_21 myip 192.168.100.21
acl ip_22 myip 192.168.100.22
acl ip_23 myip 192.168.100.23
acl ip_24 myip 192.168.100.24
acl ip_25 myip 192.168.100.25
acl ip_26 myip 192.168.100.26
acl ip_27 myip 192.168.100.27
acl ip_28 myip 192.168.100.28
acl ip_29 myip 192.168.100.29
acl ip_30 myip 192.168.100.30
acl ip_31 myip 192.168.100.31
acl ip_32 myip 192.168.100.32
acl ip_33 myip 192.168.100.33
acl ip_34 myip 192.168.100.34
acl ip_35 myip 192.168.100.35
acl ip_36 myip 192.168.100.36
acl ip_37 myip 192.168.100.37
acl ip_38 myip 192.168.100.38
acl ip_39 myip 192.168.100.39
acl ip_40 myip 192.168.100.40
acl ip_41 myip 192.168.100.41
acl ip_42 myip 192.168.100.42
acl ip_43 myip 192.168.100.43
acl ip_44 myip 192.168.100.44
acl ip_45 myip 192.168.100.45
acl ip_46 myip 192.168.100.46
acl ip_47 myip 192.168.100.47
acl ip_48 myip 192.168.100.48
acl ip_49 myip 192.168.100.49
acl ip_50 myip 192.168.100.50
acl ip_51 myip 192.168.100.51
acl ip_52 myip 192.168.100.52
acl ip_53 myip 192.168.100.53
acl ip_54 myip 192.168.100.54
acl ip_55 myip 192.168.100.55
acl ip_56 myip 192.168.100.56
acl ip_57 myip 192.168.100.57
acl ip_58 myip 192.168.100.58
acl ip_59 myip 192.168.100.59
acl ip_60 myip 192.168.100.60
acl ip_61 myip 192.168.100.61
acl ip_62 myip 192.168.100.62
acl ip_63 myip 192.168.100.63
acl ip_64 myip 192.168.100.64
acl ip_65 myip 192.168.100.65
acl ip_66 myip 192.168.100.66
acl ip_67 myip 192.168.100.67
acl ip_68 myip 192.168.100.68
acl ip_69 myip 192.168.100.69
acl ip_70 myip 192.168.100.70
acl ip_71 myip 192.168.100.71
acl ip_72 myip 192.168.100.72
acl ip_73 myip 192.168.100.73
acl ip_74 myip 192.168.100.74
acl ip_75 myip 192.168.100.75
acl ip_76 myip 192.168.100.76
acl ip_77 myip 192.168.100.77
acl ip_78 myip 192.168.100.78
acl ip_79 myip 192.168.100.79
acl ip_80 myip 192.168.100.80
acl ip_81 myip 192.168.100.81
acl ip_82 myip 192.168.100.82
acl ip_83 myip 192.168.100.83
acl ip_84 myip 192.168.100.84
acl ip_85 myip 192.168.100.85
acl ip_86 myip 192.168.100.86
acl ip_87 myip 192.168.100.87
acl ip_88 myip 192.168.100.88
acl ip_89 myip 192.168.100.89
acl ip_90 myip 192.168.100.90
acl ip_91 myip 192.168.100.91
acl ip_92 myip 192.168.100.92
acl ip_93 myip 192.168.100.93
acl ip_94 myip 192.168.100.94
acl ip_95 myip 192.168.100.95
acl ip_96 myip 192.168.100.96
acl ip_97 myip 192.168.100.97
acl ip_98 myip 192.168.100.98
acl ip_99 myip 192.168.100.99
acl ip_100 myip 192.168.100.100
acl ip_101 myip 192.168.100.101
acl ip_102 myip 192.168.100.102
acl ip_103 myip 192.168.100.103
acl ip_104 myip 192.168.100.104
acl ip_105 myip 192.168.100.105
acl ip_106 myip 192.168.100.106
acl ip_107 myip 192.168.100.107
acl ip_108 myip 192.168.100.108
acl ip_109 myip 192.168.100.109
acl ip_110 myip 192.168.100.110
acl ip_111 myip 192.168.100.111
acl ip_112 myip 192.168.100.112
acl ip_113 myip 192.168.100.113
acl ip_114 myip 192.168.100.114
acl ip_115 myip 192.168.100.115
acl ip_116 myip 192.168.100.116
acl ip_117 myip 192.168.100.117
acl ip_118 myip 192.168.100.118
acl ip_119 myip 192.168.100.119
acl ip_120 myip 192.168.100.120
acl ip_121 myip 192.168.100.121
acl ip_122 myip 192.168.100.122
acl ip_123 myip 192.168.100.123
acl ip_124 myip 192.168.100.124
acl ip_125 myip 192.168.100.125
acl ip_126 myip 192.168.100.126
acl ip_127 myip 192.168.100.127
acl ip_128 myip 192.168.100.128
acl ip_129 myip 192.168.100.129
acl ip_130 myip 192.168.100.130
acl ip_131 myip 192.168.100.131
acl ip_132 myip 192.168.100.132
acl ip_133 myip 192.168.100.133
acl ip_134 myip 192.168.100.134
acl ip_135 myip 192.168.100.135
acl ip_136 myip 192.168.100.136
acl ip_137 myip 192.168.100.137
acl ip_138 myip 192.168.100.138
acl ip_139 myip 192.168.100.139
acl ip_140 myip 192.168.100.140
acl ip_141 myip 192.168.100.141
acl ip_142 myip 192.168.100.142
acl ip_143 myip 192.168.100.143
acl ip_144 myip 192.168.100.144
acl ip_145 myip 192.168.100.145
acl ip_146 myip 192.168.100.146
acl ip_147 myip 192.168.100.147
acl ip_148 myip 192.168.100.148
acl ip_149 myip 192.168.100.149
acl ip_150 myip 192.168.100.150
acl ip_151 myip 192.168.100.151
acl ip_152 myip 192.168.100.152
acl ip_153 myip 192.168.100.153
acl ip_154 myip 192.168.100.154
acl ip_155 myip 192.168.100.155
acl ip_156 myip 192.168.100.156
acl ip_157 myip 192.168.100.157
acl ip_158 myip 192.168.100.158
acl ip_159 myip 192.168.100.159
acl ip_160 myip 192.168.100.160
acl ip_161 myip 192.168.100.161
acl ip_162 myip 192.168.100.162
acl ip_163 myip 192.168.100.163
acl ip_164 myip 192.168.100.164
acl ip_165 myip 192.168.100.165
acl ip_166 myip 192.168.100.166
acl ip_167 myip 192.168.100.167
acl ip_168 myip 192.168.100.168
acl ip_169 myip 192.168.100.169
acl ip_170 myip 192.168.100.170
acl ip_171 myip 192.168.100.171
acl ip_172 myip 192.168.100.172
acl ip_173 myip 192.168.100.173
acl ip_174 myip 192.168.100.174
acl ip_175 myip 192.168.100.175
acl ip_176 myip 192.168.100.176
acl ip_177 myip 192.168.100.177
acl ip_178 myip 192.168.100.178
acl ip_179 myip 192.168.100.179
acl ip_180 myip 192.168.100.180
acl ip_181 myip 192.168.100.181
acl ip_182 myip 192.168.100.182
acl ip_183 myip 192.168.100.183
acl ip_184 myip 192.168.100.184
acl ip_185 myip 192.168.100.185
acl ip_186 myip 192.168.100.186
acl ip_187 myip 192.168.100.187
acl ip_188 myip 192.168.100.188
acl ip_189 myip 192.168.100.189
acl ip_190 myip 192.168.100.190
acl ip_191 myip 192.168.100.191
acl ip_192 myip 192.168.100.192
acl ip_193 myip 192.168.100.193
acl ip_194 myip 192.168.100.194
acl ip_195 myip 192.168.100.195
acl ip_196 myip 192.168.100.196
acl ip_197 myip 192.168.100.197
acl ip_198 myip 192.168.100.198
acl ip_199 myip 192.168.100.199
acl ip_200 myip 192.168.100.200
tcp_outgoing_address 192.168.100.1 ip_1
tcp_outgoing_address 192.168.100.2 ip_2
tcp_outgoing_address 192.168.100.3 ip_3
tcp_outgoing_address 192.168.100.4 ip_4
tcp_outgoing_address 192.168.100.5 ip_5
tcp_outgoing_address 192.168.100.6 ip_6
tcp_outgoing_address 192.168.100.7 ip_7
tcp_outgoing_address 192.168.100.8 ip_8
tcp_outgoing_address 192.168.100.9 ip_9
tcp_outgoing_address 192.168.100.10 ip_10
tcp_outgoing_address 192.168.100.11 ip_11
tcp_outgoing_address 192.168.100.12 ip_12
tcp_outgoing_address 192.168.100.13 ip_13
tcp_outgoing_address 192.168.100.14 ip_14
tcp_outgoing_address 192.168.100.15 ip_15
tcp_outgoing_address 192.168.100.16 ip_16
tcp_outgoing_address 192.168.100.17 ip_17
tcp_outgoing_address 192.168.100.18 ip_18
tcp_outgoing_address 192.168.100.19 ip_19
tcp_outgoing_address 192.168.100.20 ip_20
tcp_outgoing_address 192.168.100.21 ip_21
tcp_outgoing_address 192.168.100.22 ip_22
tcp_outgoing_address 192.168.100.23 ip_23
tcp_outgoing_address 192.168.100.24 ip_24
tcp_outgoing_address 192.168.100.25 ip_25
tcp_outgoing_address 192.168.100.26 ip_26
tcp_outgoing_address 192.168.100.27 ip_27
tcp_outgoing_address 192.168.100.28 ip_28
tcp_outgoing_address 192.168.100.29 ip_29
tcp_outgoing_address 192.168.100.30 ip_30
tcp_outgoing_address 192.168.100.31 ip_31
tcp_outgoing_address 192.168.100.32 ip_32
tcp_outgoing_address 192.168.100.33 ip_33
tcp_outgoing_address 192.168.100.34 ip_34
tcp_outgoing_address 192.168.100.35 ip_35
tcp_outgoing_address 192.168.100.36 ip_36
tcp_outgoing_address 192.168.100.37 ip_37
tcp_outgoing_address 192.168.100.38 ip_38
tcp_outgoing_address 192.168.100.39 ip_39
tcp_outgoing_address 192.168.100.40 ip_40
tcp_outgoing_address 192.168.100.41 ip_41
tcp_outgoing_address 192.168.100.42 ip_42
tcp_outgoing_address 192.168.100.43 ip_43
tcp_outgoing_address 192.168.100.44 ip_44
tcp_outgoing_address 192.168.100.45 ip_45
tcp_outgoing_address 192.168.100.46 ip_46
tcp_outgoing_address 192.168.100.47 ip_47
tcp_outgoing_address 192.168.100.48 ip_48
tcp_outgoing_address 192.168.100.49 ip_49
tcp_outgoing_address 192.168.100.50 ip_50
tcp_outgoing_address 192.168.100.51 ip_51
tcp_outgoing_address 192.168.100.52 ip_52
tcp_outgoing_address 192.168.100.53 ip_53
tcp_outgoing_address 192.168.100.54 ip_54
tcp_outgoing_address 192.168.100.55 ip_55
tcp_outgoing_address 192.168.100.56 ip_56
tcp_outgoing_address 192.168.100.57 ip_57
tcp_outgoing_address 192.168.100.58 ip_58
tcp_outgoing_address 192.168.100.59 ip_59
tcp_outgoing_address 192.168.100.60 ip_60
tcp_outgoing_address 192.168.100.61 ip_61
tcp_outgoing_address 192.168.100.62 ip_62
tcp_outgoing_address 192.168.100.63 ip_63
tcp_outgoing_address 192.168.100.64 ip_64
tcp_outgoing_address 192.168.100.65 ip_65
tcp_outgoing_address 192.168.100.66 ip_66
tcp_outgoing_address 192.168.100.67 ip_67
tcp_outgoing_address 192.168.100.68 ip_68
tcp_outgoing_address 192.168.100.69 ip_69
tcp_outgoing_address 192.168.100.70 ip_70
tcp_outgoing_address 192.168.100.71 ip_71
tcp_outgoing_address 192.168.100.72 ip_72
tcp_outgoing_address 192.168.100.73 ip_73
tcp_outgoing_address 192.168.100.74 ip_74
tcp_outgoing_address 192.168.100.75 ip_75
tcp_outgoing_address 192.168.100.76 ip_76
tcp_outgoing_address 192.168.100.77 ip_77
tcp_outgoing_address 192.168.100.78 ip_78
tcp_outgoing_address 192.168.100.79 ip_79
tcp_outgoing_address 192.168.100.80 ip_80
tcp_outgoing_address 192.168.100.81 ip_81
tcp_outgoing_address 192.168.100.82 ip_82
tcp_outgoing_address 192.168.100.83 ip_83
tcp_outgoing_address 192.168.100.84 ip_84
tcp_outgoing_address 192.168.100.85 ip_85
tcp_outgoing_address 192.168.100.86 ip_86
tcp_outgoing_address 192.168.100.87 ip_87
tcp_outgoing_address 192.168.100.88 ip_88
tcp_outgoing_address 192.168.100.89 ip_89
tcp_outgoing_address 192.168.100.90 ip_90
tcp_outgoing_address 192.168.100.91 ip_91
tcp_outgoing_address 192.168.100.92 ip_92
tcp_outgoing_address 192.168.100.93 ip_93
tcp_outgoing_address 192.168.100.94 ip_94
tcp_outgoing_address 192.168.100.95 ip_95
tcp_outgoing_address 192.168.100.96 ip_96
tcp_outgoing_address 192.168.100.97 ip_97
tcp_outgoing_address 192.168.100.98 ip_98
tcp_outgoing_address 192.168.100.99 ip_99
tcp_outgoing_address 192.168.100.100 ip_100
tcp_outgoing_address 192.168.100.101 ip_101
tcp_outgoing_address 192.168.100.102 ip_102
tcp_outgoing_address 192.168.100.103 ip_103
tcp_outgoing_address 192.168.100.104 ip_104
tcp_outgoing_address 192.168.100.105 ip_105
tcp_outgoing_address 192.168.100.106 ip_106
tcp_outgoing_address 192.168.100.107 ip_107
tcp_outgoing_address 192.168.100.108 ip_108
tcp_outgoing_address 192.168.100.109 ip_109
tcp_outgoing_address 192.168.100.110 ip_110
tcp_outgoing_address 192.168.100.111 ip_111
tcp_outgoing_address 192.168.100.112 ip_112
tcp_outgoing_address 192.168.100.113 ip_113
tcp_outgoing_address 192.168.100.114 ip_114
tcp_outgoing_address 192.168.100.115 ip_115
tcp_outgoing_address 192.168.100.116 ip_116
tcp_outgoing_address 192.168.100.117 ip_117
tcp_outgoing_address 192.168.100.118 ip_118
tcp_outgoing_address 192.168.100.119 ip_119
tcp_outgoing_address 192.168.100.120 ip_120
tcp_outgoing_address 192.168.100.121 ip_121
tcp_outgoing_address 192.168.100.122 ip_122
tcp_outgoing_address 192.168.100.123 ip_123
tcp_outgoing_address 192.168.100.124 ip_124
tcp_outgoing_address 192.168.100.125 ip_125
tcp_outgoing_address 192.168.100.126 ip_126
tcp_outgoing_address 192.168.100.127 ip_127
tcp_outgoing_address 192.168.100.128 ip_128
tcp_outgoing_address 192.168.100.129 ip_129
tcp_outgoing_address 192.168.100.130 ip_130
tcp_outgoing_address 192.168.100.131 ip_131
tcp_outgoing_address 192.168.100.132 ip_132
tcp_outgoing_address 192.168.100.133 ip_133
tcp_outgoing_address 192.168.100.134 ip_134
tcp_outgoing_address 192.168.100.135 ip_135
tcp_outgoing_address 192.168.100.136 ip_136
tcp_outgoing_address 192.168.100.137 ip_137
tcp_outgoing_address 192.168.100.138 ip_138
tcp_outgoing_address 192.168.100.139 ip_139
tcp_outgoing_address 192.168.100.140 ip_140
tcp_outgoing_address 192.168.100.141 ip_141
tcp_outgoing_address 192.168.100.142 ip_142
tcp_outgoing_address 192.168.100.143 ip_143
tcp_outgoing_address 192.168.100.144 ip_144
tcp_outgoing_address 192.168.100.145 ip_145
tcp_outgoing_address 192.168.100.146 ip_146
tcp_outgoing_address 192.168.100.147 ip_147
tcp_outgoing_address 192.168.100.148 ip_148
tcp_outgoing_address 192.168.100.149 ip_149
tcp_outgoing_address 192.168.100.150 ip_150
tcp_outgoing_address 192.168.100.151 ip_151
tcp_outgoing_address 192.168.100.152 ip_152
tcp_outgoing_address 192.168.100.153 ip_153
tcp_outgoing_address 192.168.100.154 ip_154
tcp_outgoing_address 192.168.100.155 ip_155
tcp_outgoing_address 192.168.100.156 ip_156
tcp_outgoing_address 192.168.100.157 ip_157
tcp_outgoing_address 192.168.100.158 ip_158
tcp_outgoing_address 192.168.100.159 ip_159
tcp_outgoing_address 192.168.100.160 ip_160
tcp_outgoing_address 192.168.100.161 ip_161
tcp_outgoing_address 192.168.100.162 ip_162
tcp_outgoing_address 192.168.100.163 ip_163
tcp_outgoing_address 192.168.100.164 ip_164
tcp_outgoing_address 192.168.100.165 ip_165
tcp_outgoing_address 192.168.100.166 ip_166
tcp_outgoing_address 192.168.100.167 ip_167
tcp_outgoing_address 192.168.100.168 ip_168
tcp_outgoing_address 192.168.100.169 ip_169
tcp_outgoing_address 192.168.100.170 ip_170
tcp_outgoing_address 192.168.100.171 ip_171
tcp_outgoing_address 192.168.100.172 ip_172
tcp_outgoing_address 192.168.100.173 ip_173
tcp_outgoing_address 192.168.100.174 ip_174
tcp_outgoing_address 192.168.100.175 ip_175
tcp_outgoing_address 192.168.100.176 ip_176
tcp_outgoing_address 192.168.100.177 ip_177
tcp_outgoing_address 192.168.100.178 ip_178
tcp_outgoing_address 192.168.100.179 ip_179
tcp_outgoing_address 192.168.100.180 ip_180
tcp_outgoing_address 192.168.100.181 ip_181
tcp_outgoing_address 192.168.100.182 ip_182
tcp_outgoing_address 192.168.100.183 ip_183
tcp_outgoing_address 192.168.100.184 ip_184
tcp_outgoing_address 192.168.100.185 ip_185
tcp_outgoing_address 192.168.100.186 ip_186
tcp_outgoing_address 192.168.100.187 ip_187
tcp_outgoing_address 192.168.100.188 ip_188
tcp_outgoing_address 192.168.100.189 ip_189
tcp_outgoing_address 192.168.100.190 ip_190
tcp_outgoing_address 192.168.100.191 ip_191
tcp_outgoing_address 192.168.100.192 ip_192
tcp_outgoing_address 192.168.100.193 ip_193
tcp_outgoing_address 192.168.100.194 ip_194
tcp_outgoing_address 192.168.100.195 ip_195
tcp_outgoing_address 192.168.100.196 ip_196
tcp_outgoing_address 192.168.100.197 ip_197
tcp_outgoing_address 192.168.100.198 ip_198
tcp_outgoing_address 192.168.100.199 ip_199
tcp_outgoing_address 192.168.100.200 ip_200



http_access allow radius-auth
request_header_access Via deny all
request_header_access X-Forwarded-For deny all
EOF

##配置SS5自动启动
cat>/etc/rc.d/rc.local<<EOF
#!/bin/bash
touch /var/local/subsys/local
mkdir -p /var/run/ss5
for i in `seq 6001 6200`
do
usleep 300
ss5 -m -t -u socks$i -b 0.0.0.0:$i
ss5radius -m -t -u socks$i -b 0.0.0.0:$(($i+1000))
done
EOF
chmod +x /etc/rc.d/rc.local





##添加带用户名密码验证的HTTP(S)代理
安装squid和httpd
yum -y install squid 


配置文件:
http_port 3128
auth_param basic program /usr/lib64/squid/basic_radius_auth -f -f /etc/squid/squid_radius.conf
auth_param basic children 5
auth_param basic realm Web-Proxy
auth_param basic credentialsttl 5 minute
auth_param basic casesensitive off
 
acl radius-auth proxy_auth REQUIRED
http_access allow radius-auth
http_access allow localhost
http_access deny all

  

CENTOS7配多IP出口socks5和http代理

标签:chmod   tput   pos   source   pen   bind   ret   deny   ice   

原文地址:https://www.cnblogs.com/ip99/p/13220934.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!