route ignored for VLAN interface
by King Arthur from LinuxQuestions.org on (#6NQMM)
I'm running Debian Bookworm on a small PC that's used as a (VLAN) router. Everything has been running flawlessly for several months.
Now I wanted to add a static route to a virtual network of a virtual machine running on my server. The network interfaces are configured via .network and .netdev files in /etc/systemd/network. I tried to add a static route via the network interface that my router is connected to by adding the [route] section to the .netdev file of the interface:
Code:[Match]
Name=enp3s0.103
[Network]
DHCP=no
[Address]
Address=192.168.3.1/24
# route for Home Assistant VM
[Route]
Gateway=192.168.3.14
Destination=192.168.122.2
GatewayOnLink=yes
Metric=1000However with
Code:ip route listthe route is not displayed.
If something goes wrong, where should I be able to see an errror message? And what did I do wrong or is there a better way to define such a static route?
Now I wanted to add a static route to a virtual network of a virtual machine running on my server. The network interfaces are configured via .network and .netdev files in /etc/systemd/network. I tried to add a static route via the network interface that my router is connected to by adding the [route] section to the .netdev file of the interface:
Code:[Match]
Name=enp3s0.103
[Network]
DHCP=no
[Address]
Address=192.168.3.1/24
# route for Home Assistant VM
[Route]
Gateway=192.168.3.14
Destination=192.168.122.2
GatewayOnLink=yes
Metric=1000However with
Code:ip route listthe route is not displayed.
If something goes wrong, where should I be able to see an errror message? And what did I do wrong or is there a better way to define such a static route?