greysky-zfj 发表于 2010-07-15 15:43

squid的tcp_outgoing_address

本帖最后由 greysky-zfj 于 2010-07-15 16:09 编辑

squid 3.0

squid.conf:

acl ip1 src 192.168.0.0/24
tcp_outgoing_address 192.168.0.251 ip1


这样的话,squid是否用192.168.0.251地址去访问web?为啥我的不成功呢?



文档里面是这么说的


#        Example where requests from 10.0.0.0/24 will be forwarded
#        with source address 10.1.0.1, 10.0.2.0/24 forwarded with
#        source address 10.1.0.2 and the rest will be forwarded with
#        source address 10.1.0.3.
#
#        acl normal_service_net src 10.0.0.0/24
#        acl good_service_net src 10.0.1.0/24 10.0.2.0/24
#        tcp_outgoing_address 10.1.0.1 normal_service_net
#        tcp_outgoing_address 10.1.0.2 good_service_net
#        tcp_outgoing_address 10.1.0.3


大概的意思应当是
10.0.0.0/24指定为10.1.0.1
10.0.1.0/24 10.0.2.0/24指定为10.1.0.2
其余的指定为10.1.0.3
如果我理解正确的话,为啥我上述配置后,在日志里面出现的地址不是192.168.0.251呢?

chengxiaowei 发表于 2014-06-10 14:47

你src定义错了,那个应该写地址,比如www.sohu.com
那么就是通过192.168.0.251 去访问www.sohu.com
页: [1]
查看完整版本: squid的tcp_outgoing_address