diff options
| author | rtk0c <[email protected]> | 2025-03-05 22:39:35 -0800 |
|---|---|---|
| committer | rtk0c <[email protected]> | 2025-03-05 22:39:35 -0800 |
| commit | 3432f70e6bd78123664f751f803f1003b46e93eb (patch) | |
| tree | 3a5ff4f3d26df8bafd42e35d52f7e396ffa88025 | |
| parent | 62bffb53ab361a0c6a8815b79d15ada97eba3e9e (diff) | |
Revise adventures-on-monitorless-server
| -rw-r--r-- | content/blog/adventures-on-monitorless-server.md | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/content/blog/adventures-on-monitorless-server.md b/content/blog/adventures-on-monitorless-server.md index 524c600..47b61db 100644 --- a/content/blog/adventures-on-monitorless-server.md +++ b/content/blog/adventures-on-monitorless-server.md @@ -5,16 +5,15 @@ tags: ["networking"] ShowToc: false --- -# TL;DR -What happens when you forget to statically assign an IP address to a server running `NetworkManager` or `systemd-netword` or even Debian's default networking setup? -It won't have network connection until IP assigned (because the subnet doesn't have a DHCP in router for example), so no SSH. -But you also don't have access to video output. +A story of frantically rescuing a deployed headless server, where I forget to statically assign an IP address. +It just won't have network connection. No SSH. No fixie. -Instead of typing into the TTY hoping for the best, all 3 of the aforementioned systems default to DHCP, and _there is nothing saying a DHCP server has to be running on the router or gateway_. +Except _there is nothing saying a DHCP server has to be running on the router or gateway_. So, just install and configure `kea` (or a DHCP server of your choice) on any other computer on the network, reboot the server in question, and voilĂ ! SSH to your hearts content. -# The story +--- + So the story goes like this. I recently got hands on a nice little old desktop tower, plenty of RAM and a good number of SATA ports for selfhosting: Seafile, Immich and what not. Now it _is_ rather old machine, with only VGA and DVI on the motherboard. This means my little trusty HDMI to USB video capture dongle won't be helpful! @@ -23,17 +22,23 @@ I need to bring a monitor that has a VGA port on it. So I at the comfort of my home, I took some time to install Debian, as well as all other packages I could possibly need. Also configured a SSH key. -## Uh oh -And as all good stories go, the _one thing_ I was supposed to do was not done: no monitor, no way to see what's happening on screen to configure its WiFi connection properly. -No network, no SSH-ing either. -For reasons beyond the topic of this story, my parents' router does not have an DHCP server running if connected to the ethernet ports. -I _have_ to connect WiFi or manually set a static IP on the `eth0` interface. +And as all good stories go, the _one thing_ I was supposed to do was not done. I didn't assign a static IP to `eth0` beforehand. + +_Uh. oh._ + +There is no proper DHCP in the lan, I had everything else setup with static IPs. I don't know its MAC, so no calculating SLAAC by hand to get a link local IPv6 either. In fact, if I remember correctly I don't even think the gateway was properly setup with IPv6 at all. + +No network, no SSH. + +No monitor, no way to see what's happening on screen to configure its WiFi connection properly. Quickly, I thought "what if I could just type out all the commands without a monitor?" Trying to open vim on `/etc/network/interfaces` and blindly modifying a complex configuration file obviously did not work so well. Although I did figure out one helpful tidbit: since this machine has a beeper, I can run things like `foobar && tput bel` in TTY to get an audio confirmation that something succeeded. After ten minutes of desparately trying various commands and questioning if I had been making typos all along, an enlightenment suddenly found its way into my mind: nothing is stopping me from running an ad-hoc DHCP server just for this purpose! -[Kea](https://www.isc.org/kea/) is apparently the recommended implementation, so I installed it on my laptop, and after some fiddling of configs per https://wiki.archlinux.org/title/Kea (because ArchWiki is the one wiki to rule them all), it did work. The server allocates the first address in the pool, so I just picked `192.168.233.1/16` and successfully SSH-ed in. +As far as I know, all of the networking implementations shipped by various Linux distros default to DHCP. This includes `NetworkManager`, `systemd-networkd`, or even Debian's default networking setup. + +[Kea](https://www.isc.org/kea/) is apparently the recommended implementation, so I installed it on my laptop, and after some fiddling of configs per the [ArchWiki](https://wiki.archlinux.org/title/Kea) (because ArchWiki is the one wiki to rule them all), it did work. The server allocates the first address in the pool, so I just picked `192.168.233.1/16` and successfully SSH-ed in. No need to drive 30 minutes round trip to get my VGA monitor! |
