Eu tenho um par de modems 3G instalados no meu RaspberryPI via hub USB com adaptador de energia externa. O objetivo é criar várias conexões ppp através destes modems e compartilhar a internet via proxy socks5 (1 portadora - > 1 porta dedicada).
root@raspberrypi:/etc# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.88.81 netmask 255.255.255.0 broadcast 192.168.88.255
inet6 fe80::be35:5f3a:e942:e39a prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:92:b1:0b txqueuelen 1000 (Ethernet)
RX packets 8747 bytes 702623 (686.1 KiB)
RX errors 0 dropped 2448 overruns 0 frame 0
TX packets 1452 bytes 183993 (179.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 4 bytes 156 (156.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4 bytes 156 (156.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ppp-kyivstar0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.203.1.38 netmask 255.255.255.255 destination 10.64.64.64
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 16 bytes 382 (382.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 16 bytes 514 (514.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
ppp-vodafone0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1440
inet 100.87.250.240 netmask 255.255.255.255 destination 10.64.64.65
ppp txqueuelen 3 (Point-to-Point Protocol)
RX packets 7 bytes 58 (58.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 7 bytes 82 (82.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
O arquivo de configuração do dante-server é assim:
root@raspberrypi:/etc# grep -v "^#" /etc/danted-vodafone0.conf | grep -v "^$"
debug: 0
logoutput: stderr stdout
internal: 192.168.88.81 port = 50002
internal: 127.0.0.1 port = 50002
external: ppp-vodafone0
socksmethod: none
clientmethod: none
user.privileged: proxy
user.unprivileged: nobody
user.libwrap: nobody
client pass {
from: 192.168.88.0/24 port 1-65535 to: 0.0.0.0/0
}
client pass {
from: 127.0.0.0/8 port 1-65535 to: 0.0.0.0/0
}
client block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
socks block {
from: 0.0.0.0/0 to: lo
log: connect error
}
socks pass {
from: 192.168.88.0/24 to: 0.0.0.0/0
protocol: tcp udp
}
socks pass {
from: 127.0.0.0/8 to: 0.0.0.0/0
protocol: tcp udp
}
socks block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
Quando tento testar isso com o curl, nada acontece:
# curl -v --socks5 192.168.88.81:50002 http://ifconfig.co
* Rebuilt URL to: http://ifconfig.co/
* Trying 192.168.88.81...
* TCP_NODELAY set
* SOCKS5 communication to ifconfig.co:80
* SOCKS5 connect to IPv4 104.27.140.78 (locally resolved)
* Can't complete SOCKS5 connection to 0.0.0.0:0. (6)
* Closing connection 0
curl: (7) Can't complete SOCKS5 connection to 0.0.0.0:0. (6)
De outro lado, o curl é capaz de fazer uma conexão através dessa interface quando eu o especifico como parâmetro:
# curl -v --interface ppp-vodafone0 http://ifconfig.co
* Rebuilt URL to: http://ifconfig.co/
* Trying 104.27.140.78...
* TCP_NODELAY set
* Local Interface ppp-vodafone0 is ip 100.120.201.176 using address family 2
* Local port: 0
* Connected to ifconfig.co (104.27.140.78) port 80 (#0)
> GET / HTTP/1.1
> Host: ifconfig.co
> User-Agent: curl/7.52.1
> Accept: */*
>
< HTTP/1.1 200 OK
< Date: Sat, 08 Sep 2018 00:20:50 GMT
< Content-Type: text/plain; charset=utf-8
< Content-Length: 14
< Connection: keep-alive
< Set-Cookie: __cfduid=df1da9ab56a621c1a8e3a1e75faac555c1536366050; expires=Sun, 08-Sep-19 00:20:50 GMT; path=/; domain=.ifconfig.co; HttpOnly
< Via: 1.1 vegur
< Server: cloudflare
< CF-RAY: 456d4066058483ee-KBP
<
46.133.227.38
* Curl_http_done: called premature == 0
* Connection #0 to host ifconfig.co left intact
O que pode estar errado aqui?