nxtrace / NTrace-core

NextTrace, an open source visual route tracking CLI tool
https://www.nxtrace.org
GNU General Public License v3.0
5.76k stars 340 forks source link

`--source` and `--dev` doesn't work on macOS #147

Closed SukkaW closed 1 year ago

SukkaW commented 1 year ago

你正在使用哪个版本的 nexttrace?

$ nexttrace --version
NextTrace 1.1.7-1 2023-06-03T21:27:21Z brew

你看到的异常现象是什么?

I am using Surge Mac with the Enhanced Mode enabled, which will start a TUN device on the macOS:

$ ifconfig

// [redacted]
utun8: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 65535
    inet 198.18.0.1 --> 198.18.0.1 netmask 0xffffffff
    nd6 options=201<PERFORMNUD,DAD>
en3: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=6467<RXCSUM,TXCSUM,VLAN_MTU,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
    ether [redacted]
    inet6 fe80::1c59:a458:83e7:8af2%en3 prefixlen 64 secured scopeid 0x7
    inet 192.168.60.254 netmask 0xffffff00 broadcast 192.168.60.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect (1000baseT <full-duplex>)
    status: active

In order to bypass Surge's Enhanced Mode when tracrouting, I need to specify the trace to use source address 192.168.60.254 bound on en3.

However, nexttrace is not respecting --dev nor --source:

$ nexttrace --dev en3 1.0.0.1
NextTrace 1.1.7-1 2023-06-03T21:27:21Z brew
IP Geo Data Provider: LeoMoeAPI
traceroute to 1.0.0.1, 30 hops max, 52 bytes packets
1   198.18.0.1      *        [RFC2544]        局域网
                                              0.41 ms / 0.34 ms / 0.42 ms
2   *
3   *
4   *
5   *
6   *
7   *
$ nexttrace --source 192.168.60.254 1.0.0.1
NextTrace 1.1.7-1 2023-06-03T21:27:21Z brew
IP Geo Data Provider: LeoMoeAPI
traceroute to 1.0.0.1, 30 hops max, 52 bytes packets
1   198.18.0.1      *        [RFC2544]        局域网
                                              0.61 ms / 0.43 ms / 0.50 ms
2   *
3   *
4   *
5   *
6   *
7   *

你期待看到的正常表现是怎样的?

$ mtr -a 192.168.60.254 1.0.0.1
                                                                                                                                                                                                 Packets               Pings
 Host                                                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 192.168.60.1                                      0.0%     6    0.7   0.9   0.6   1.2   0.2
 2. 172.31.251.1                                     33.3%     6   28.3  27.8  27.4  28.3   0.4
 3. [ Redacted ]                                      0.0%     6   35.3  39.4  30.5  55.3   8.8
 4. 10.54.0.1                                         0.0%     6   32.0  32.5  31.6  33.9   0.8
 5. 13335.hkg.equinix.com                             0.0%     6   32.4  33.6  32.4  37.0   1.7
 6. 103.22.203.231                                    0.0%     5   38.7  37.0  33.1  43.5   4.4
 7. one.one.one.one                                   0.0%     5   32.3  32.5  32.1  33.0   0.3
$ mtr -I en3 1.0.0.1
                                                                                                                                                                                                 Packets               Pings
 Host                                                Loss%   Snt   Last   Avg  Best  Wrst StDev
 1. 192.168.60.1                                      0.0%     6    0.7   0.9   0.6   1.2   0.2
 2. 172.31.251.1                                     33.3%     6   28.3  27.8  27.4  28.3   0.4
 3. [ Redacted ]                                      0.0%     6   35.3  39.4  30.5  55.3   8.8
 4. 10.54.0.1                                         0.0%     6   32.0  32.5  31.6  33.9   0.8
 5. 13335.hkg.equinix.com                             0.0%     6   32.4  33.6  32.4  37.0   1.7
 6. 103.22.203.231                                    0.0%     5   38.7  37.0  33.1  43.5   4.4
 7. one.one.one.one                                   0.0%     5   32.3  32.5  32.1  33.0   0.3

请附上你的命令

nexttrace --dev en3 1.0.0.1
nexttrace --source 192.168.60.254 1.0.0.1

请附上出错时软件输出的错误信息

N/A

是否查询过本仓库wiki有没有类似错误

N/A

sjlleo commented 1 year ago

Hi SukkaW,

I'm very sorry for the late reply, as I've been really busy lately.

This looks like it was caused by a member overriding some parameters on one of the commits, which did get received but didn't get passed to the raw_socket listener.

I'll test and fix this as soon as I can.

Thank you very much!

Best Regards, Leo Shen

tsosunchia commented 1 year ago

已经修复了,您可以在这里下载: https://github.com/nxtrace/Ntrace-V1/releases/tag/v1.1.8

如还有任何问题,可再次开启issue,谢谢。