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

zeekctl: Error: must run zeekctl on same machine as the manager node 127.0.0.1 vs 127.0.1.1 #44

Open
initconf opened this issue Nov 11, 2022 · 1 comment

Comments

@initconf
Copy link

So, I saw this error when running zeekctl ( and zeekctl cron):

Error: must run zeekctl on same machine as the manager node. The manager node has IP address 
127.0.1.1 and this machine has IP addresses: 128.3.x.y, fe80::3eec:efff:fe28:8c5a, 
fe80::3eec:efff:fe28:8c5b, 127.0.0.1, ::1

Turns out this is some soft Linuxism where linux's netcfg creates this entry in /etc/hosts where

127.0.0.1 localhost
127.0.1.1 fqdn 

This seems to have surfaced quite suddently and automatically on me.

While I changed the node.cfg to explicity use IP address instead of hostname as a workaround, I do see that /usr/local/zeek/lib/broctl/ZeekControl/config.py has hardcoded 127.0.0.1, ::1

Would be useful if zeekctl (aka config.py) handles 127.0.0.0/8 instead

PS: https://serverfault.com/questions/363095/why-does-my-hostname-appear-with-the-address-127-0-1-1-rather-than-127-0-0-1-in

@awelzel awelzel transferred this issue from zeek/zeek Nov 14, 2022
@awelzel
Copy link
Contributor

awelzel commented Nov 14, 2022

Moved issue to zeekctl. I suppose we could run the following hunk regardless of what ifconfig / ip address returned and add them to the list:

localaddrs = ["127.0.0.1", "::1"]
try:
addrinfo = socket.getaddrinfo(socket.gethostname(), None, 0, 0, socket.SOL_TCP)
except Exception:
addrinfo = []
for ai in addrinfo:
localaddrs.append(ai[4][0])

Over here:

In [3]: [ai[4] for ai in socket.getaddrinfo(socket.gethostname(), None, 0, 0, socket.SOL_TCP)]
Out[3]: [('127.0.1.1', 0)]

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

No branches or pull requests

2 participants