我在带有自定义Linux系统的freescale imx6板上使用avahi(由buildroot构建)。
所以我使用avahi进行地址分配(eth0:avahi)和主机名解析。 我的freescale imx6板也使用另一个接口,其中一个“静态”网络地址用于其他子网掩码(eth0)。
我还创建了另一个接口eth0:0和另一个地址(这个第三个以太网地址只是为了解我的问题而创建的)
我的freescale imx6板的ifconfig:
eth0 Link encap:Ethernet HWaddr 1E:ED:19:27:1A:B3
inet addr:192.168.1.212 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3037485 errors:0 dropped:0 overruns:0 frame:0
TX packets:12312042 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:213265042 (203.3 MiB) TX bytes:1150418317 (1.0 GiB)
eth0:0 Link encap:Ethernet HWaddr 1E:ED:19:27:1A:B3
inet addr:134.124.45.23 Bcast:134.124.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
eth0:avahi Link encap:Ethernet HWaddr 1E:ED:19:27:1A:B3
inet addr:169.254.6.124 Bcast:169.254.255.255 Mask:255.255.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:484 errors:0 dropped:0 overruns:0 frame:0
TX packets:484 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:32284 (31.5 KiB) TX bytes:32284 (31.5 KiB)
对于我的测试,我使用与我的freescale imx6板连接的电脑。我从这台电脑上启动命令“avahi-browse -a -c -r -v”。
当我从我的电脑上启动avahi-browes时,我可以看到freescale imx6板的主机名(name.local),但它与接口eth0:0的地址相关联,而不是eth0:avahi。当我删除接口eth0:0时,freescale imx6板的主机名与eth0相关联。
从我的电脑上,我可以使用eth0,eth0:avahi地址和eth0:0(当它被激活时)ping freescale imx6 board
我的问题:我想,当我启动命令“avahi-browse -a -c -r -v”时,我的freescale imx6板返回与eth0:avahi相关的地址,因为目前我的freescale imx6板返回最后一个接口可配置(在我的例子中,eth0:0) 你知道怎么做吗?
感谢您的回答,