여러 IP 인터페이스를 통해 트래픽을 전달하도록 Dante sockd를 구성했습니다. 기본적으로 구성은 다음과 같습니다.
logoutput: /var/log/sockd.log
debug: 1
socksmethod: username none
internal: eth0 port = 60000
external: eth0
internal: eth0:0 port = 60000
external: eth0:0
internal: eth0:1 port = 60000
external: eth0:1
internal: eth0:2 port = 60000
external: eth0:2
...
external.rotation: same-same
client pass {
from: 0.0.0.0/0 port 1-65535 to: 0.0.0.0/0
socksmethod: username
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
socksmethod: username
protocol: tcp udp
}
'external.rotation = same.same'을 사용하지 않으면 트래픽이 서버를 통해 전달되지만 하나의 주소에서만 나갑니다. 활성화되면 컬을 사용하면 다음 오류가 발생합니다.
curl: (7) Can't complete SOCKS5 connection to x.x.x.x:80. (3)
로그에 다음 오류가 있습니다.
May 15 07:38:38 (1431689918.007569) sockd[4887]: info: block(1): tcp/accept ]: x.x.x.x.56066 y.y.y.y.60000: request was not performed due to error: could not get address to use on external side: using external.rotation = same-same, local address x.x.x.x was selected for forwarding from our local client x.x.x.x.56066 to target z.z.z.z.80, but that local address is not set on our external interface(s). Configuration error in /etc/sockd.conf?
xxxx는 내 IP 주소이고, yyyy는 서버 측 주소이고 zzzz는 대상 주소입니다.
이는 서버가 내 주소로 가장할 것으로 예상하지만 구성되지 않았음을 암시합니다. 트래픽이 선택할 수 있는 주소가 100개가 넘는 yyyy 주소에서 오는 것으로 표시되기를 원하기 때문에 이는 올바른 것입니다.
문서에서 내가 보고 있는 오류와 일치하는 항목을 찾을 수 없으며 일종의 라운드 로빈 구성이 필요한 것으로 의심되지만 그것도 찾을 수 없습니다. 이런 식으로 이 작품을 만든 사람이 있나요?
답변1
다음은 CentOS 6.x 64비트의 Dante 1.4.2에서 작동했지만 SSH 터널을 통해 Dante에 액세스하기 때문에 인증을 사용하지 않습니다(내 서버의 IP는 1.1.1.1, 2.2.2.2 및 3.3.3.3입니다).
logoutput: syslog stdout stderr /var/log/sockd.log
internal: eth0:0 port = 1080
internal: eth0:1 port = 1080
internal: eth0:2 port = 1080
external: eth0:0
external: eth0:1
external: eth0:2
external.rotation: same-same
user.privileged: root
user.unprivileged: sockd
#user.libwrap: sockd
clientmethod: none
socksmethod: none
client pass {
from: 1.1.1.1/32 to: 0.0.0.0/0
log: error # connect disconnect
}
client pass {
from: 2.2.2.2/32 to: 0.0.0.0/0
log: error # connect disconnect
}
client pass {
from: 3.3.3.3/32 to: 0.0.0.0/0
log: error # connect disconnect
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
command: bind connect udpassociate
log: error # connect disconnect iooperation
}
socks pass {
from: 0.0.0.0/0 to: 0.0.0.0/0
command: bindreply udpreply
log: error # connect disconnect iooperation
}
그런 다음 내 클라이언트 컴퓨터에서 세 개의 로컬 터널을 만들었습니다.
ssh -L 10801:1.1.1.1:1080 -L 10802:2.2.2.2:1080 -L 10803:3.3.3.3:1080 [email protected]
설정과 관련하여 겪은 대부분의 문제는 권한 문제(클라이언트 패스 및 양말 패스) 때문인 것 같습니다.
여전히 문제가 있는 경우 Dante: 3Proxy의 대안을 시도해 볼 수 있습니다.
다음과 같은 방법으로 3proxy를 구성합니다.
nserver 8.8.8.8
auth none
daemon
socks -p1080 -i1.1.1.1 -e1.1.1.1
socks -p1080 -i2.2.2.2 -e2.2.2.2
socks -p1080 -i3.3.3.3 -e3.3.3.3
pidfile /var/run/3proxy.pid
log /dev/null
도움이 되었기를 바랍니다.
답변2
OS에 대한 IP 전달을 활성화해 보셨습니까?
sysctl -w net.ipv4.ip_forward=1
또는
echo 1 > /proc/sys/net/ipv4/ip_forward
추가 정보 @http://linuxconfig.org/how-to-turn-on-off-ip-forwarding-in-linux