我们公司制造了一款基于 Jetson Nano 的 3D 打印机。该打印机使用 wifi 适配器连接到互联网,但对于初始设置,用户必须使用以太网连接将打印机连接到他们的其中一台设备。打印机正在运行 dnsmasq-base,这样当用户导航到 http:// 时,他们就可以访问服务器并进行配置。
问题是,当他们通过以太网连接到 jetsonNano 时,它会禁用主机设备上的 Wifi。并通过打印机路由所有流量!并且在设置打印机的 wifi 之前,它们会失去所有连接。
理想情况下,我们希望有一种解决方案,允许用户通过有线连接设置打印机,而不需要用户在其设备上进行任何配置更改。
从 dnsmasq.conf 的文档中我尝试过
dhcp-range=192.168.0.1,proxy
但似乎没有什么区别。
我复制了以下路由表:
连接以太网的路由表:
Internet:
Destination Gateway Flags Netif Expire
default 10.42.2.1 UGScg en0
default 192.168.0.1 UGScIg en1
10.42.2/24 link#6 UCS en0 !
10.42.2.1/32 link#6 UCS en0 !
10.42.2.1 48:b0:2d:55:9a:2 UHLWIir en0 1178
10.42.2.31/32 link#6 UCS en0 !
127 127.0.0.1 UCS lo0
127.0.0.1 127.0.0.1 UH lo0
169.254 link#6 UCS en0 !
169.254 link#13 UCSI en1 !
192.168.0 link#13 UCS en1 !
192.168.0.1/32 link#13 UCS en1 !
192.168.0.1 84:94:8c:c3:5a:c2 UHLWIir en1 1184
192.168.0.26/32 link#13 UCS en1 !
192.168.0.26 14:98:77:69:2b:52 UHLWI lo0
192.168.0.28 54:60:9:b8:8b:a2 UHLWIi en1 775
192.168.0.29 1c:bf:ce:69:6c:8f UHLWI en1 1173
224.0.0/4 link#6 UmCS en0 !
224.0.0/4 link#13 UmCSI en1 !
224.0.0.251 1:0:5e:0:0:fb UHmLWI en1
239.255.255.250 1:0:5e:7f:ff:fa UHmLWI en0
239.255.255.250 1:0:5e:7f:ff:fa UHmLWI en1
255.255.255.255/32 link#6 UCS en0 !
255.255.255.255/32 link#13 UCSI en1 !
Internet6:
Destination Gateway Flags Netif Expire
default fe80::%utun0 UGcIg utun0
default fe80::%utun1 UGcIg utun1
default fe80::%utun2 UGcIg utun2
::1 ::1 UHL lo0
fc00::/7 fe80::8694:8cff:fec3:5ac2%en1 UGc en1
fd00:8494:8cc3:5ac2::/64 link#13 UC en1
fd00:8494:8cc3:5ac2:1c34:bcef:8dbd:3cf4 14:98:77:69:2b:52 UHL lo0
fe80::%lo0/64 fe80::1%lo0 UcI lo0
fe80::1%lo0 link#1 UHLI lo0
fe80::%anpi0/64 link#4 UCI anpi0
fe80::f475:7bff:fe58:8642%anpi0 f6:75:7b:58:86:42 UHLI lo0
fe80::%anpi1/64 link#5 UCI anpi1
fe80::f475:7bff:fe58:8643%anpi1 f6:75:7b:58:86:43 UHLI lo0
fe80::%en0/64 link#6 UCI en0
fe80::1ca0:231b:2a4b:e1ea%en0 14:98:77:70:b1:7a UHLI lo0
fe80::%en1/64 link#13 UCI en1
fe80::105e:139:9e45:390f%en1 14:98:77:69:2b:52 UHLI lo0
fe80::8694:8cff:fec3:5ac2%en1 84:94:8c:c3:5a:c2 UHLWIi en1
fe80::%awdl0/64 link#15 UCI awdl0
fe80::4c4c:15ff:fe96:990a%awdl0 4e:4c:15:96:99:a UHLI lo0
fe80::%llw0/64 link#16 UCI llw0
fe80::4c4c:15ff:fe96:990a%llw0 4e:4c:15:96:99:a UHLI lo0
fe80::%utun0/64 fe80::a66b:2336:f54b:b872%utun0 UcI utun0
fe80::a66b:2336:f54b:b872%utun0 link#17 UHLI lo0
fe80::%utun1/64 fe80::3390:e111:6ec6:ec21%utun1 UcI utun1
fe80::3390:e111:6ec6:ec21%utun1 link#18 UHLI lo0
fe80::%utun2/64 fe80::ce81:b1c:bd2c:69e%utun2 UcI utun2
fe80::ce81:b1c:bd2c:69e%utun2 link#19 UHLI lo0
ff00::/8 ::1 UmCI lo0
ff00::/8 link#4 UmCI anpi0
ff00::/8 link#5 UmCI anpi1
ff00::/8 link#6 UmCI en0
ff00::/8 link#13 UmCI en1
ff00::/8 link#15 UmCI awdl0
ff00::/8 link#16 UmCI llw0
ff00::/8 fe80::a66b:2336:f54b:b872%utun0 UmCI utun0
ff00::/8 fe80::3390:e111:6ec6:ec21%utun1 UmCI utun1
ff00::/8 fe80::ce81:b1c:bd2c:69e%utun2 UmCI utun2
ff01::%lo0/32 ::1 UmCI lo0
ff01::%anpi0/32 link#4 UmCI anpi0
ff01::%anpi1/32 link#5 UmCI anpi1
ff01::%en0/32 link#6 UmCI en0
ff01::%en1/32 link#13 UmCI en1
ff01::%awdl0/32 link#15 UmCI awdl0
ff01::%llw0/32 link#16 UmCI llw0
ff01::%utun0/32 fe80::a66b:2336:f54b:b872%utun0 UmCI utun0
ff01::%utun1/32 fe80::3390:e111:6ec6:ec21%utun1 UmCI utun1
ff01::%utun2/32 fe80::ce81:b1c:bd2c:69e%utun2 UmCI utun2
ff02::%lo0/32 ::1 UmCI lo0
ff02::%anpi0/32 link#4 UmCI anpi0
ff02::%anpi1/32 link#5 UmCI anpi1
ff02::%en0/32 link#6 UmCI en0
ff02::%en1/32 link#13 UmCI en1
ff02::%awdl0/32 link#15 UmCI awdl0
ff02::%llw0/32 link#16 UmCI llw0
ff02::%utun0/32 fe80::a66b:2336:f54b:b872%utun0 UmCI utun0
ff02::%utun1/32 fe80::3390:e111:6ec6:ec21%utun1 UmCI utun1
ff02::%utun2/32 fe80::ce81:b1c:bd2c:69e%utun2 UmCI utun2
未连接 ETH:
Internet:
Destination Gateway Flags Netif Expire
default 192.168.0.1 UGScg en1
127 127.0.0.1 UCS lo0
127.0.0.1 127.0.0.1 UH lo0
169.254 link#13 UCS en1 !
192.168.0 link#13 UCS en1 !
192.168.0.1/32 link#13 UCS en1 !
192.168.0.1 84:94:8c:c3:5a:c2 UHLWIir en1 1195
192.168.0.26/32 link#13 UCS en1 !
192.168.0.26 14:98:77:69:2b:52 UHLWI lo0
192.168.0.28 54:60:9:b8:8b:a2 UHLWIi en1 1196
192.168.0.29 1c:bf:ce:69:6c:8f UHLWIi en1 1195
224.0.0/4 link#13 UmCS en1 !
224.0.0.251 1:0:5e:0:0:fb UHmLWI en1
239.255.255.250 1:0:5e:7f:ff:fa UHmLWI en1
255.255.255.255/32 link#13 UCS en1 !
Internet6:
Destination Gateway Flags Netif Expire
default fe80::%utun0 UGcIg utun0
default fe80::%utun1 UGcIg utun1
default fe80::%utun2 UGcIg utun2
::1 ::1 UHL lo0
fc00::/7 fe80::8694:8cff:fec3:5ac2%en1 UGc en1
fd00:8494:8cc3:5ac2::/64 link#13 UC en1
fd00:8494:8cc3:5ac2:1c34:bcef:8dbd:3cf4 14:98:77:69:2b:52 UHL lo0
fe80::%lo0/64 fe80::1%lo0 UcI lo0
fe80::1%lo0 link#1 UHLI lo0
fe80::%anpi0/64 link#4 UCI anpi0
fe80::f475:7bff:fe58:8642%anpi0 f6:75:7b:58:86:42 UHLI lo0
fe80::%anpi1/64 link#5 UCI anpi1
fe80::f475:7bff:fe58:8643%anpi1 f6:75:7b:58:86:43 UHLI lo0
fe80::%en1/64 link#13 UCI en1
fe80::105e:139:9e45:390f%en1 14:98:77:69:2b:52 UHLI lo0
fe80::8694:8cff:fec3:5ac2%en1 84:94:8c:c3:5a:c2 UHLWIi en1
fe80::%awdl0/64 link#15 UCI awdl0
fe80::4c4c:15ff:fe96:990a%awdl0 4e:4c:15:96:99:a UHLI lo0
fe80::%llw0/64 link#16 UCI llw0
fe80::4c4c:15ff:fe96:990a%llw0 4e:4c:15:96:99:a UHLI lo0
fe80::%utun0/64 fe80::a66b:2336:f54b:b872%utun0 UcI utun0
fe80::a66b:2336:f54b:b872%utun0 link#17 UHLI lo0
fe80::%utun1/64 fe80::3390:e111:6ec6:ec21%utun1 UcI utun1
fe80::3390:e111:6ec6:ec21%utun1 link#18 UHLI lo0
fe80::%utun2/64 fe80::ce81:b1c:bd2c:69e%utun2 UcI utun2
fe80::ce81:b1c:bd2c:69e%utun2 link#19 UHLI lo0
ff00::/8 ::1 UmCI lo0
ff00::/8 link#4 UmCI anpi0
ff00::/8 link#5 UmCI anpi1
ff00::/8 link#6 UmCI en0
ff00::/8 link#13 UmCI en1
ff00::/8 link#15 UmCI awdl0
ff00::/8 link#16 UmCI llw0
ff00::/8 fe80::a66b:2336:f54b:b872%utun0 UmCI utun0
ff00::/8 fe80::3390:e111:6ec6:ec21%utun1 UmCI utun1
ff00::/8 fe80::ce81:b1c:bd2c:69e%utun2 UmCI utun2
ff01::%lo0/32 ::1 UmCI lo0
ff01::%anpi0/32 link#4 UmCI anpi0
ff01::%anpi1/32 link#5 UmCI anpi1
ff01::%en0/32 link#6 UmCI en0
ff01::%en1/32 link#13 UmCI en1
ff01::%awdl0/32 link#15 UmCI awdl0
ff01::%llw0/32 link#16 UmCI llw0
ff01::%utun0/32 fe80::a66b:2336:f54b:b872%utun0 UmCI utun0
ff01::%utun1/32 fe80::3390:e111:6ec6:ec21%utun1 UmCI utun1
ff01::%utun2/32 fe80::ce81:b1c:bd2c:69e%utun2 UmCI utun2
ff02::%lo0/32 ::1 UmCI lo0
ff02::%anpi0/32 link#4 UmCI anpi0
ff02::%anpi1/32 link#5 UmCI anpi1
ff02::%en0/32 link#6 UmCI en0
ff02::%en1/32 link#13 UmCI en1
ff02::%awdl0/32 link#15 UmCI awdl0
ff02::%llw0/32 link#16 UmCI llw0
ff02::%utun0/32 fe80::a66b:2336:f54b:b872%utun0 UmCI utun0
ff02::%utun1/32 fe80::3390:e111:6ec6:ec21%utun1 UmCI utun1
ff02::%utun2/32 fe80::ce81:b1c:bd2c:69e%utun2 UmCI utun2
答案1
问题是,当他们通过以太网连接到 jetsonNano 时,它会禁用主机设备上的 Wifi。并通过打印机路由所有流量!并且在设置打印机的 wifi 之前,它们会失去所有连接。
默认情况下,dnsmasq
将其运行所在的主机报告为默认路由。这意味着当您的客户端连接到 jetsonNano 时,它将成为其默认路由 - 并且由于它实际上没有连接到任何其他东西,因此它变成了一个黑色的整体。
解决方案可能很简单,只需告诉dnsmasq
不要通告默认路由:
dhcp-option=option:router
dhcp-option=option:dns-server
这告诉dnsmasq
不要将自己宣传为默认网关或 DNS 服务器。
请注意,如果您的客户端使用 192.168.0.0/24 作为其本地网络,您仍然会遇到问题。由于 192.168.1.0/24 和 192.168.0.0/24 都相当常见,请考虑使用其他网络作为您的配置网络。