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

Add static IP address configuration #210

Open
klosz007 opened this issue Dec 17, 2024 · 7 comments
Open

Add static IP address configuration #210

klosz007 opened this issue Dec 17, 2024 · 7 comments

Comments

@klosz007
Copy link

I understand this KVM is probably dedicated to use with Tailscale and dynamic IPs are non-issue.
But think what happens if DHCP server runs on a computer box controlled by this KVM device.
If this computer is powered off then it might happen that KVM will not be able to obtain IP or renew it.
It must be possible to set KVM to use static IP and not depend on external service (e.g. DHCP).

@th3cube
Copy link

th3cube commented Dec 18, 2024

@L00maca
Copy link

L00maca commented Dec 19, 2024

Having it on the GUI would still be nice, even tho I'd argue not an high priority.

@klosz007
Copy link
Author

klosz007 commented Dec 19, 2024

That's what I meant - I silently assumed that such basic setting (static IP address) should be in GUI. And if it is not there then it's not possible. Indeed I was wrong/my fault - it is possible to set static IP but via CLI only. The request is then to make it possible via GUI.

@jkotran
Copy link

jkotran commented Jan 4, 2025

I set a static IP per the manual. How do I set my DNS server?

@th3cube
Copy link

th3cube commented Jan 4, 2025

That's what I meant - I silently assumed that such basic setting (static IP address) should be in GUI. And if it is not there then it's not possible. Indeed I was wrong/my fault - it is possible to set static IP but via CLI only. The request is then to make it possible via GUI.

I completely agree. There should be an option to set this via the GUI; it would make the process much more user-friendly.


I set a static IP as per the manual. How do I configure my DNS server?

That's weird. The behavior is unexpected. I thought this would be handled via the resolv.conf file located in the /boot/ directory, which is copied over to /etc/. However, that’s not the case. Instead, the file gets overwritten on every reboot, and also hardcoded external DNS servers from locations like China, Google, and Singapore are applied.

Additionally, there seem to be typos in the scripts responsible for handling this, and there is other scripting involved that overrides the expected behavior. Also the first DNS Calculated from the gw of the static ip file is applied wrong. A developer should investigate this further. For example, here’s a snippet of the script:

arping -Dqc2 -Ieth0 $addr || continue
ip a add $inet brd + dev eth0
ip r add default via $gw dev eth0
cat > /etc/resolve.conf << EOF
nameserver $gw
nameserver 8.8.8.8
nameserver 114.114.114.114
EOF
break

There should be no hardcoded external DNS servers unless there is a valid reason for it. Instead, the DNS servers provided by DHCP or configured in the static configuration file should be applied. Why hardcode external DNS?

Examples of the hardcoded DNS servers:

nameserver 8.8.8.8        # Google
nameserver 114.114.114.114 # Singapur?
nameserver 119.29.29.29   # China?
nameserver 223.5.5.5      # China?

For now, I’ve set the DNS servers manually in /etc/resolv.conf and made the file immutable using:
chattr +i /etc/resolv.conf

This prevents it from being overwritten on reboot. However, this is just a temporary workaround. It would be interesting to hear what the developers have to say about this behavior.

@jkotran
Copy link

jkotran commented Jan 4, 2025

@th3cube Thank you for the immutable tip. That's useful.

@klosz007
Copy link
Author

klosz007 commented Jan 6, 2025

I opened another issue for this DNS issus: #245
I suggest you post your findings about DNS there.

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

4 participants