Skip to content

Instantly share code, notes, and snippets.

@badeadanut
badeadanut / README.md
Created September 26, 2022 10:39 — forked from wllmsash/assigning-static-ip-addresses-in-wsl2.md
Assigning a Static IP Address to a WSL2 Distribution

Assigning a Static IP Address to a WSL2 Distribution

Hyper-V creates a hidden virtual switch for WSL2. In Windows, the virtual NIC vEthernet (WSL) is connected to the switch. In WSL2 (Ubuntu), the virtual NIC eth0 is connected to the switch. Communication between the two network endpoints happens over the switch. The virtual NICs (and possibly the switch) are ephemeral and disappear at host system restart time. The NICs are recreated on demand when WSL2 first runs.

To use a custom static IP address we can assign each of the NICs to IP addresses on a shared subnet. It's a good idea to pick a subnet in the Private Address range.

@badeadanut
badeadanut / self-signed-certificate-with-custom-ca.md
Created January 20, 2022 22:45 — forked from fntlnz/self-signed-certificate-with-custom-ca.md
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096