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

Direct Ethernet connection - Create dhcp lease fallback. #2

Open
amrsoll opened this issue Oct 27, 2020 · 1 comment
Open

Direct Ethernet connection - Create dhcp lease fallback. #2

amrsoll opened this issue Oct 27, 2020 · 1 comment

Comments

@amrsoll
Copy link

amrsoll commented Oct 27, 2020

DHCP Fallback

This StackOverflow QA gives an example of a fallback DHCP server if no DHCP server is discovered on the network.

This should allow people to connect directly to the machine without using WiFi.

dhclient should support fallback via lease declaration
have a look at the dhclient.conf man page.

Add something like this to your dhclient.conf

timeout 10;
lease {
interface "eth0";
fixed-address 10.0.0.10;
option subnet-mask 255.255.255.0;
renew 2 2022/1/1 00:00:01;
rebind 2 2022/1/1 00:00:01;
expire 2 2022/1/1 0:00:01;
}

or you can assign a second IP to the interface like /etc/network/interfaces

auto lo
iface lo inet loopback
iface eth0 inet dhcp

auto eth0:1
iface eth0:1 inet static
address 10.10.10.2
netmask 255.255.255.0

We could also use DNSMasq, but it might conflict with netconnectd

DNS resolution

If using DNSMasq, it might interfere with other dhcp services and hostname resolution, but it could be an interesting alternative.
Here is an example config file for dnsmasq

Other good related posts:

Automatically Create Hotspot if no Network is Available
Systemd-Networkd
Systemd-resolved

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

1 participant