BiglySoftware / BiglyBT

Feature-filled Bittorrent client based on the Azureus open source project
https://www.biglybt.com
GNU General Public License v2.0
1.55k stars 153 forks source link

[Linux] teredo/miredo interface not visible to BiglyBT #1856

Closed txtsd closed 2 years ago

txtsd commented 3 years ago

Under Connection > Advanced Network Settings, it doesn't show my miredo interface:

Example: 192.168.1.5;eth0;eth1[2] will bind the specified IP, to all IPs of the 1st interface and the 3rd IP of the 2nd interface.
Interface descriptions can be matched by using a regular expression within round brackets, e.g. (Teredo).
The 1st IP will be used for all services, all others are only used for load balancing.
The following interfaces are available:
    lo  (lo)
        lo[0]   127.0.0.1
    vmnet1  (vmnet1)
        vmnet1[0]   192.168.193.1
    eth0    (eth0)
        eth0[0] 192.168.0.20
    vmnet8  (vmnet8)
        vmnet8[0]   172.16.75.1

While ip link shows this:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000
    link/ether 30:9c:23:83:fb:33 brd ff:ff:ff:ff:ff:ff
3: vmnet1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 00:50:56:c0:00:01 brd ff:ff:ff:ff:ff:ff
4: vmnet8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 1000
    link/ether 00:50:56:c0:00:08 brd ff:ff:ff:ff:ff:ff
8: miredo: <POINTOPOINT,MULTICAST,NOARP,UP,LOWER_UP> mtu 1280 qdisc fq_codel state UNKNOWN mode DEFAULT group default qlen 500
    link/none 

miredo is confirmed working by visiting https://ipv6.google.com and also ipv6 connections in qBittorrent.

SWT v4934r5, gtk/3.24.23, zoom=100, dpi=96 Linux v5.9.2-1-ck-zen, amd64 (64 bit) B2.5.0.0/4 az3

parg commented 3 years ago

Not sure if it is significant but did you enable IPv6 support under Options->Connection->Advanced Network Settings ?

txtsd commented 3 years ago

Yes, it's checked! :sweat_smile:

parg commented 3 years ago

No idea why Java isn't making that inteface visible to BiglyBT then :(

txtsd commented 3 years ago

Is there anything else that could affect its visibility?

parg commented 3 years ago

Unfortunately I don't know much about linux networking - does it show up when you run ifconfig?

There's an entry further down that config page to ignore IPv6 interfaces, can't imagine you've checked that?

txtsd commented 3 years ago

It does show up in ifconfig:

λ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.20  netmask 255.255.255.0  broadcast 192.168.0.255
        inet6 fe80::b6a9:a5bf:71a5:828f  prefixlen 64  scopeid 0x20<link>
        ether 30:9c:23:83:fb:33  txqueuelen 1000  (Ethernet)
        RX packets 102290955  bytes 54751663251 (50.9 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 137008957  bytes 122823301058 (114.3 GiB)
        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 748456  bytes 1387732687 (1.2 GiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 748456  bytes 1387732687 (1.2 GiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

miredo: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST>  mtu 1280
        inet6 fe80::ffff:ffff:ffff  prefixlen 64  scopeid 0x20<link>
        inet6 2001:0:53aa:64c:28:693c:d28d:6f0  prefixlen 32  scopeid 0x0<global>
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 500  (UNSPEC)
        RX packets 2595  bytes 1238359 (1.1 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 3903  bytes 922068 (900.4 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.193.1  netmask 255.255.255.0  broadcast 192.168.193.255
        inet6 fe80::250:56ff:fec0:1  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:01  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 37540  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vmnet8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 172.16.75.1  netmask 255.255.255.0  broadcast 172.16.75.255
        inet6 fe80::250:56ff:fec0:8  prefixlen 64  scopeid 0x20<link>
        ether 00:50:56:c0:00:08  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 31608  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

And nope, none of the ignore options are checked.

I also tried swapping between openjdk 8, 11, and 14 with no luck.

parg commented 3 years ago

I installed it on kubuntu - it shows up as 'teredo', not 'miredo', in the BiglyBT config when running in a debugger.

Java 1.8.0_272 (64 bit) Private Build /usr/lib/jvm/java-8-openjdk-amd64/jre

The following interfaces are available: enp0s3 (enp0s3) enp0s3[0] fe80:0:0:0:1e57:657c:98ef:b4a6%enp0s3 enp0s3[1] 10.0.2.15 lo (lo) lo[0] 0:0:0:0:0:0:0:1%lo lo[1] 127.0.0.1 teredo (teredo) teredo[0] fe80:0:0:0:0:ffff:ffff:ffff%teredo teredo[1] 2001:0:53aa:64c:2c6b:1872:ae64:342d%teredo teredo[2] fe80:0:0:0:8957:8094:981e:4216%teredo

I did some searching around and found this in the biglyby startup script

JAVA_PROPS="-Djava.net.preferIPv4Stack=true"

Try commenting that out...

txtsd commented 3 years ago

Emptying that variable did the trick!

Example: 192.168.1.5;eth0;eth1[2] will bind the specified IP, to all IPs of the 1st interface and the 3rd IP of the 2nd interface.
Interface descriptions can be matched by using a regular expression within round brackets, e.g. (Teredo).
The 1st IP will be used for all services, all others are only used for load balancing.
The following interfaces are available:
    lo  (lo)
        lo[0]   0:0:0:0:0:0:0:1%lo
        lo[1]   127.0.0.1
    vmnet1  (vmnet1)
        vmnet1[0]   fe80:0:0:0:250:56ff:fec0:1%vmnet1
        vmnet1[1]   192.168.193.1
    miredo  (miredo)
        miredo[0]   2001:0:53aa:64c:6:6532:8cba:99b%miredo
        miredo[1]   fe80:0:0:0:0:ffff:ffff:ffff%miredo
    eth0    (eth0)
        eth0[0] fe80:0:0:0:b6a9:a5bf:71a5:828f%eth0
        eth0[1] 192.168.0.20
    vmnet8  (vmnet8)
        vmnet8[0]   fe80:0:0:0:250:56ff:fec0:8%vmnet8
        vmnet8[1]   172.16.75.1

mlDHT finally shows a number for ipv6 instead of initializing

Here's a network test log:

Test starting
Default public address is 115.69.246.100
Bindable addresses: 0:0:0:0:0:0:0:1%lo, 127.0.0.1, fe80:0:0:0:250:56ff:fec0:1%vmnet1, 192.168.193.1, 2001:0:53aa:64c:6:6532:8cba:99b%miredo, fe80:0:0:0:0:ffff:ffff:ffff%miredo, fe80:0:0:0:b6a9:a5bf:71a5:828f%eth0, 192.168.0.20, fe80:0:0:0:250:56ff:fec0:8%vmnet8, 172.16.75.1
1 NAT device found
    Archer C60: address=192.168.0.1:1900, public address=169.254.115.157
No SOCKS proxy found
No HTTP proxy found
No explicit bind address set
Testing HTTP outbound
    Test successful
Testing TCP outbound
    Test successful
Testing UDP outbound
    Test successful
Testing TCP port 18118 inbound
    Test failed: NAT test failed: No route to host (115.69.246.100:18118)
    Check your port forwarding for TCP 18118
Testing UDP port 18118 inbound
    Sending outbound packet and waiting for reply probe (timeout=5000)
    Sending outbound packet and waiting for reply probe (timeout=10000)
    Sending outbound packet and waiting for reply probe (timeout=15000)
    Sending completion event
    Test failed: Inbound test failed
    Check your port forwarding for UDP 18118
1 public/external addresses found
    115.69.246.100
    AS details: as=45415,asn=VASAICABLEPVTLTD-AS-IN Vasai Cable Pvt. Ltd., IN, bgp_prefx=115.69.246.0/24[/115.69.246.0-/115.69.246.255]
BiglyBT Services test
    BiglyBT Website - www.biglybt.com
        Certificate: CN=biglybt.com
        Connection result: 200/OK
    Version Server - version.biglybt.com
        Connection result: 200/OK
    Plugins Website - plugins.biglybt.com
        Certificate: CN=biglybt.com
        Connection result: 200/OK
Distributed protocol test
  Incoming routing established for B34B9D6B1043E1AADFA0590AE089CBBD0D651155
  Searching 128 contacts for 8 test targets
  Making outbound connection to /115.66.241.44:5511
  Making outbound connection to /89.45.6.60:11599
  Making outbound connection to /62.101.251.190:22237
  Making outbound connection to /74.98.209.222:11399
  Making outbound connection to /73.199.28.17:16324
  Making outbound connection to /83.152.101.221:58626
  Making outbound connection to /24.66.41.87:24189
  Making outbound connection to /14.199.122.49:55474
  Making outbound connection to /96.3.164.91:27376
  Making outbound connection to /71.47.79.127:41692
  Making outbound connection to /86.5.90.2:19556
  Searching complete, 11 targets found
    Status: sessions=11, out_attempts=11, out_connect=11, in_connect=0
    Status: sessions=11, out_attempts=11, out_connect=11, in_connect=0
  Destroying tester
  Results
IPv6 test
    Default public IPv6 address: 2001:0:53aa:64c:6:6532:8cba:99b%miredo
    Testing connectivity...
    Outbound,Leecher,connected, hand sent, hand recv, bitf sent, bitf recv
    Outbound,Seed,connected, hand sent, hand recv, bitf sent, bitf recv
    Outbound,Leecher,connected, hand sent, hand recv, bitf sent, bitf recv
    Outbound,Seed,connected, hand sent, hand !recv, bitf !sent, bitf !recv
    Outbound,Leecher,connected, hand sent, hand !recv, bitf !sent, bitf !recv
    Outbound,Seed,connected, hand sent, hand recv, bitf sent, bitf recv
    Outbound,Leecher,connected, hand sent, hand recv, bitf sent, bitf recv
    Outbound,Seed,connected, hand sent, hand !recv, bitf !sent, bitf !recv
    Outbound,Leecher,connected, hand sent, hand recv, bitf sent, bitf recv
    Outbound,Seed,connected, hand sent, hand recv, bitf sent, bitf recv
    Outbound,Leecher,connected, hand sent, hand recv, bitf sent, bitf recv
    No incoming connections received, likely NAT problems
  Incoming routing destroyed for B34B9D6B1043E1AADFA0590AE089CBBD0D651155
        Connect failed
Test complete

It doesn't look like ipv6 is working properly, but my ipv4 NAT test fails on forwarded ports every single time anyway.

EDIT: I'm seeing ipv6 peers so apparently it's working properly. EDIT2: Does this mean BiglyBT has not been able to connect to ipv6 peers on linux by default?

txtsd commented 3 years ago

I suggest omitting this line in the next build: JAVA_PROPS="-Djava.net.preferIPv4Stack=true" so ipv6 works by default on linux systems.