Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

当在linux上时,得到的是docker0的地址 #73

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

当在linux上时,得到的是docker0的地址 #73

wants to merge 1 commit into from

Conversation

doodoocoder
Copy link

当在linux上时,得到的是docker0的地址,直接选最后一个ip地址即为“真实”ip即可

当在linux上时,得到的是docker0的地址,直接选最后一个ip地址即为“真实”ip
@yuyijq
Copy link
Contributor

yuyijq commented Sep 16, 2019

@doodoocoder 谢谢

不过选最后一个就代表选的是真实ip么? 是巧合,还是确实就是这样呢?有依据么
这里确实困扰我很久

@doodoocoder
Copy link
Author

我在windows 10测试了,环境是一个虚拟网卡(virtualbox虚拟出来的),一个真实的局域网地址,选取最后一个能得到真实的局域网ip地址,在linux上测试,环境是安装了docker,选取最后一个就是真实的局域网地址,但在云服务器上,得不到真实的外网地址,只能得到局域网的地址,我建议这个地址直接在实时broker,delay broker中配置,不用代码获取,最稳当,你觉得呢?

@yuyijq
Copy link
Contributor

yuyijq commented Sep 17, 2019

@doodoocoder
配置也是一个办法,但是有点麻烦,每一台都要去单独配置,我看看有没有别的什么办法

@yuyijq
Copy link
Contributor

yuyijq commented Sep 17, 2019

@doodoocoder
不过可以加上配置的选项

@BrickXu
Copy link

BrickXu commented May 7, 2020

这个修改应该不是最终方案,老代码在某些装了docker的机器上依然可以拿到正确的IP地址,应该是和ioctl的SIOCGIFCONF有关系,暂时没查到这个列表的内部sort规则。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants