NickCao / nixos-riscv

MIT License
64 stars 11 forks source link

Make the Duo use the RNDIS host as a default gw. #18

Closed mcdonc closed 8 months ago

mcdonc commented 8 months ago

Use dnsmasq hacks to detect the IP address of the RNDIS host and set it as the default gateway.

Also document what should be done on the host to get ip forwarding and masquerading working.

NickCao commented 8 months ago

I feel that we might should do the opposite, run the dhcp server on the host and client on the duo, that makes gateway configuration work by default.

mcdonc commented 8 months ago

I feel that we might should do the opposite, run the dhcp server on the host and client on the duo, that makes gateway configuration work by default.

Yeah, that would make more sense to me too, but that's not how RNDIS works. We could ditch RNDIS, but I'm not sure how to replace it with anything more sensible.

NickCao commented 8 months ago

but that's not how RNDIS works

Isn't RDNIS just like an ethernet cable (but over USB)? It should work both ways.

mcdonc commented 8 months ago

but that's not how RNDIS works

Isn't RDNIS just like an ethernet cable (but over USB)? It should work both ways.

Oh yeah, I guess that's true! Sorry, I wasn't thinking clearly.

It would be great if we could even get rid of DHCP entirely.

mcdonc commented 8 months ago

Much saner now.

NickCao commented 8 months ago

We may also drop the static mac address thing.

mcdonc commented 8 months ago

Just noticed that without the static host MAC address, following the instructions I give in duo-256.nix to set up a static host IP will tie the connection to the interface represented by the Duo's specific initial random MAC, and rebooting the host or replugging the device may cause a second connection to be created, which will have to be configured with the right stuff, etc etc. You can fix this by removing the MAC from the "Restrict to device" list, which, at least in the KDE UI, causes it to be only associated with the interface, not a specific MAC on that interface.