TelegramMessenger / MTProxy

5.01k stars 830 forks source link

can not bind local address #371

Open A-A-T-i-P opened 4 years ago

A-A-T-i-P commented 4 years ago

docker0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 172.17.0.1 netmask 255.255.0.0 broadcast 172.17.255.255 inet6 fe80::42:f1ff:fe2a:b969 prefixlen 64 scopeid 0x20 ether 02:42:f1:2a:b9:69 txqueuelen 0 (Ethernet) RX packets 17081 bytes 6480814 (6.4 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 8581 bytes 4401418 (4.4 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 9001 inet 172.31.4.173 netmask 255.255.240.0 broadcast 172.31.15.255 inet6 fe80::70:2dff:fef6:1cc6 prefixlen 64 scopeid 0x20 ether 02:70:2d:f6:1c:c6 txqueuelen 1000 (Ethernet) RX packets 93892 bytes 10863163 (10.8 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 138712 bytes 23094431 (23.0 MB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

When I run: $ sudo ./mtproto-proxy -M 1 -u nobody -p 8888 -H 443 -S [secret] --aes-pwd proxy-secret proxy-multi.conf --nat-info 172.31.4.173:[public IP] --address 172.31.4.173

A error happend: Bad binded IP address, can not bind 172.31.4.173.

[4442][2020-02-01 10:22:24.660574 local] Invoking engine mtproxy-0.01 compiled at Jan 2 2020 07:40:59 by gcc 7.4.0 64-bit after commit dc0c7f3de40530053189c572936ae4fd1567269b [4442][2020-02-01 10:22:24.660779 local] config_filename = 'proxy-multi.conf' [4442][2020-02-01 10:22:24.661014 local] creating 1 workers [4442][2020-02-01 10:22:24.661532 local] Bad binded IP address 172.31.4.173, search in ifconfig [4442][2020-02-01 10:22:24.662272 local] Started as [172.17.0.1:8888:4442:1580552544] [4442][2020-02-01 10:22:24.662547 local] configuration file proxy-multi.conf re-read successfully (752 bytes parsed), new configuration active [4442][2020-02-01 10:22:24.662626 local] main loop [4443][2020-02-01 10:22:24.663608 local] Bad binded IP address 172.31.4.173, search in ifconfig [4443][2020-02-01 10:22:24.664333 local] Started as [172.17.0.1:8888:4443:1580552544] [4443][2020-02-01 10:22:24.664581 local] configuration file proxy-multi.conf re-read successfully (752 bytes parsed), new configuration active [4443][2020-02-01 10:22:24.664667 local] main loop

p1ratrulezzz commented 4 years ago

You can't use private range IP address ad Public. It must be acceible via internet. If you are behind NAT (you have a router or another gateway), check your public IP using https://ifconfig.me/ and use it in --address 12.34.5.6

If still doesn't work for you, try this patch: https://github.com/p1ratrulezzz/MTProxy-1/commit/9610224fa0bd3b76fc55b5d209d7f9b89fa7e816

zhangqingfeng0105 commented 4 years ago

I have the same problem. Have you solved it?