Getting the openstack Ubuntu VM an IP address for its NIC in the private subnet

So, after fiddling for a while with all the setbacks of bringing an Ubuntu VM in the LAN where the previously deployed pfSense plays the gatekeeper, it was clear that trouble was in for longer, since the NIC wouldn’t comply and play nicely by getting the configured IP from the subnet.

The Tale of The Ubuntu That Wouldn’t Connect

You see, even though every little thing is prearranged, you have to get your hands dirty in the console anyway; you have to let that ugly QEMU VNC interface laugh at you and your foreign non-US keyboard, trying to guess where the “=” really is in that codepage mayhem. Hint: It’s not “ì” (in the Italian keyboard), so we’re swallowed into yet another discovery trip, by googling and finding by chance that some empty shift keypresses change layouts, and after finding that God blessed “=” and some other much needed symbols, like “/” and “|”, “:” the “[ ]” and “{ }”, etc. we’re ready to start typing our super-hard root password in the Blackness Of The Console.

Anyway, sorted these and other obstacles, it was evident that the network was nowhere to be found; evidence of this was the “Network is unreachable” ominous response to a simple ping. Ugh. Netplan, what hast thou dun? Yeah, sure, go get that 50-cloud-config.yaml beefed up inside /etc/netplan/ with the card’s static IP address, default gateway, DNSs, and be done and gone. But it was effectively gone after a reboot.

So, Netplan B, type all that, and then some, into a new yaml within /etc/netplan/, name it 00-myenp3s0.yaml (the name, mac address, and IP addresses are not from a live environment, if real, it’s a happenstance):

network:
  version: 2
  renderer: networkd
  ethernets:
    enp3s0:
      dhcp4: no
      optional: true
      macaddress: 50:F0:03:22:17:AB
      addresses: [192.168.192.128/24]
      nameservers:
        addresses: [192.168.192.254, 1.1.1.1]
      routes:
      - to: default
        via: 192.168.192.254

The final required steps were to netplan try followed by netplan apply, and this one survived between reboots, gave the NIC its IP address and all the info to connect. YMMV.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.