Okay, so here is my experience so far. I had Nexus 5 32GB with Android 6.0.1. Sluggish hot old phone with almost dead battery.
Decided to do something with it. I did some research and experiments and here is the final easy to repeat scenario.
After flash everything, I don't have IMEI, Mac address and IP adress. I have made the backup, how can I restore it to work again?
In TWRP goto Advanced -> Terminal, then command in shell: