python - 如何使用squid更改IP?
问题描述
我有带有 1 个主 IP 和 2 个附加 FO IP 的 VPS 服务器。我下载“squid”包来管理我的 IP 地址。我编辑了 /etc/squid/squid.conf 并添加了行(教程:https ://tastyplacement.com/squid-proxy-multiple-outgoing-ip-addresses ):
acl tasty3128 myportname 3128 src 51.75.50.116/24
http_access allow tasty3128
tcp_outgoing_address 51.75.50.116 tasty3128
acl tasty3129 myportname 3129 src 54.38.50.208/24
http_access allow tasty3129
tcp_outgoing_address 54.38.50.208 tasty3129
http_port 51.75.50.116:3128 name=3128
http_port 54.38.50.208:3129 name=3129
我怎样才能使用这个“鱿鱼”配置?我可以在哪里传递参数来使用taste3128 IP?我正在寻找有关此的信息,每个人都在谈论配置,而不是执行。将来我想通过 Python 脚本(或由 Python 执行的另一个脚本)管理 IP。
解决方案
您的代码完全正确,但行的顺序不正确;
在你的 squid.conf 中:
- 首先配置:http_port 51.75.50.116:3128 name=3128
- 然后配置:acl taste3128 myportname 3128 src 51.75.50.116/24 等等。
推荐阅读
- rx-java - 用一个值初始化 RxJava 流
- java - UserRepository 在 @Autowired 中返回 null
- laravel - 自动备份 MySQL 数据库到谷歌驱动器
- azure - 在 Azure 自动化 Powershell 脚本中使用参数数组
- java - 如何在Android中保持从baseAdapter接收到的奇数个按钮为三角形?
- android - Android Studio 平台工具-无法下载 api 24/28
- node.js - 尝试使用 npm 命令安装任何软件包时出现错误
- vuejs2 - VeeValidate 不适用于内联编辑。我正在使用 v-for 和 v-if 进行内联编辑
- java - 模拟类在运行测试时从不总是给出空指针
- javascript - Javascript [Symbol.toPrimitive](hint) 转换函数