使用haprxoy隐藏SMTP发信服务器源IP
China
隐藏用smtp发信IP防止泄漏源站IP导致被攻击..(⊙o⊙)嗯
haproxy 隐藏IP教程
代理服务器操作
安装haproxy
1 2
| # Centos 7 yum -y install haproxy
|
写入配置文件
代码复制到临时文本,修改IP后,全部复制,然后粘贴到ssh上 回车执行。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| cat > /etc/haproxy/haproxy.cfg<<-EOF global # ulimit -n 51200 defaults log global mode tcp option dontlognull timeout connect 1000ms timeout client 150000ms timeout server 150000ms frontend ssin bind *:465 #如果是普通模式,那这里就填25,如果是SSL模式,就需要填465 default_backend ssout backend ssout server server1 smtpdm.aliyun.com maxconn 204800 server server2 smtpdm.aliyun.com maxconn 204800 #这里的smtpdm.aliyun.com需要改成你的SMTP给的地址,根据你自己的实际情况修改 EOF
|
1 2
| # 查看一下配置文件内容 cat /etc/haproxy/haproxy.cfg
|
修改完成后,执行重启命令,并设为开机启动
1 2
| service haproxy restart chkconfig haproxy on
|
发信源站机器操作
修改服务器上的hosts文件
把smtp地址写进/etc/hosts文件,指向中转服务器的IP
假如我使用的是阿里云的国内邮件推送,那么它的SMTP服务器域名就是:smtpdm.aliyun.com
假如我使用的是阿里云的国外邮件推送,那么它的SMTP服务器域名就是:smtpdm-ap-southeast-1.aliyun.com
下面为参考,请根据自己机器内容改写
1 2 3 4
| 127.0.0.1 localhost ::1 localhost localhost.localdomain localhost6 localhost6.localdomain6 22.33.44.55 smtpdm.aliyun.com #22.33.44.55 就是代理服务器的IP
|
修改完成后,执行service network restart 重启网卡即可