Closed ydlr closed 3 years ago
- # Not sure when I'd have more than one interface from the DO
- # API but networks is an array nevertheless.
- self.default_gateway = droplet.networks["v4"][0]["gateway"]
+ for n in droplet.networks["v4"]:
+ if n["ip_address"] == self.public_ipv4:
+ self.default_gateway = n["gateway"]
something like this should fix it. they enabled private networking by default so there's an extra interface and it screws the routes up. this is what i mentioned on your PR for the start/stop.
Thank you. You saved me a couple hours of trying to figure out what changed. I am bookmarking https://developers.digitalocean.com/documentation/changelog/ so I'm not caught by surprise, next time.
Fixed in #9
Newly provisioned droplets become unreachable after applying nixos-infect and rebooting.
I haven't really looked into the cause yet, but when this happened a couple years ago, the problem was that DigitalOcean renamed the network interfaces.
The likely solution is to update to the bundled nixos-infect script not to hardcode interface names. This is the approach now taken upstream. See https://github.com/elitak/nixos-infect