大网数据广告活动
服务器运维问答

Squid proxy: how to link inbound IPv4+port to outbound IPv6

· 52CE 我爱测

I'm trying to setup a squid proxy that will accept multiple inbound connections on one IPv4 across a range of ports, and for each port connection to connect out on a unique IPv6 address. I've named each port connection, and desig…

问题原文

原帖链接 · user2408290 · CC BY-SA 3.0

I'm trying to setup a squid proxy that will accept multiple inbound connections on one IPv4 across a range of ports, and for each port connection to connect out on a unique IPv6 address.

I've named each port connection, and designated an ACL based on the connection name, and then I've tried to define an outgoing IPv6 for each. The script below works, in that it accepts connections on the different ports and routes out via IPv6 however, all outbound connections use the same IPv6 (user5) even though there are different ipv6 defined per user - the wierd bit is that even if I comment-out that user5 IPv6 from squid.conf, it still gets used for outbound connections.

Can anyone see whats wrong here? (using Squid 3.1.1 on Centos 6 64bit)

## declare an acl that is true for all ipv6 destinations
acl to_ipv6 dst ipv6

##tell Squid to listen on sequential ports and to designate a name for each inbound     connection. 
http_port 241.xxx.xxx.101:3128 name=3128
http_port 241.xxx.xxx.101:3129 name=3129
http_port 241.xxx.xxx.101:3130 name=3130
http_port 241.xxx.xxx.101:3131 name=3131
http_port 241.xxx.xxx.101:3132 name=3132

## designate acl based on inbound connection name
acl user1 myportname 3128 
acl user2 myportname 3129 
acl user3 myportname 3130 
acl user4 myportname 3131 
acl user5 myportname 3132 

## define outgoing IPv6 per user
tcp_outgoing_address [2001:::::::ipv61] user1
tcp_outgoing_address [2001:::::::ipv62] user2
tcp_outgoing_address [2001:::::::ipv63] user3
tcp_outgoing_address [2001:::::::ipv64] user4
##tcp_outgoing_address [2001:::::ipv65] user5
##this last IPv6 always gets used for all outbound connections, even if commented out

已采纳解答

原帖链接 · Nathan C · CC BY-SA 3.0

In Squid 3.1 you need the to_ipv6 directive after each tcp_outgoing_address line. If you upgrade to 3.2 you won't encounter this problem.

Reference: http://www.squid-cache.org/Doc/config/tcp_outgoing_address/

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2013-05-22)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。