The content is case sensitive, I will modify the existing eth0 with a ip address and vlan tag it within the operating system. vlan 10 is used in my example.
This is useful when you have a nested VMware environment and your VM is on a port group with vlan 4095 meaning all vlan can you through that port group. So in this case you would want to tag your OS with a vlan.
1. Create the 10-eth0.10.netdev file use wq! to save the content.
vi /etc/systemd/network/10-eth0.10.netdev
add the following
[NetDev]
Name=eth0.10
Kind=vlan
[VLAN]
Id=10
2. Create the 10-eth0.10.network file (use your own details)
vi /etc/systemd/network/10-eth0.10.network
add the following
[Match]
Name=eth0.10
[Network]
DHCP=no
Address=10.0.0.221/24
Gateway=10.0.0.1
DNS=10.0.0.150
Domain=vcf.sddc.lab
3. modify original file that is there.
vi /etc/systemd/network/10-eth0.network
Remove the static IP address configuration and change the configuration as following:
[Match]
Name=eth0
[Network]
VLAN=eth0.10
4. set permission to the files
chmod 644 /etc/systemd/network/10-eth0.10.netdev
chmod 644 /etc/systemd/network/10-eth0.10.network
chmod 644 /etc/systemd/network/10-eth0.network
5. Restart services
systemctl restart systemd-networkd
6.Check status
nmctl status
should say routeable in the content