I am trying to create a new virtual loopback interface (lo:metadata) with a specific IP address. I need this virtual interface to be up every time the OS boots up.
How i created it:
Code: Select all
sudo ip addr add 169.254.169.254/24 broadcast 169.254.169.255 dev lo:metadata
sudo ip link set dev lo:metadata up
Now, is there any type of /etc/network/interfaces file or something similar where one can configure static IPs for interfaces? I saw that for static IP interfaces, you go through the GUI, but for virtual interfaces this is not an option. I could also create a script that runs every time at boot, but that seems too hacky.
So, my question is: "Is there a way to configure a network interface from a configuration file?"