Running Debian 12, my ethernet card gets an IP using DHCP, and I want to add a VLAN config to that same interface, VLAN 30, and assign it a static IP. Here's my /etc/network/interfaces:
auto lo
iface lo inet loopback
# The primary network interface
auto enp0s25
allow-hotplug enp0s25
iface enp0s25 inet dhcp
#VLAN
auto enp0s25.30
iface enp0s25.30 inet static
address 192.168.30.2
netmask 255.255.255.0
gateway 192.168.30.1
vlan-raw-device enp0s25
No amount of restarting NetworkManager or rebooting gets it to activate the enp0s25.30 interface. The NetworkManger log shows only this line relating to the .30 VLAN:
NetworkManager[2239]: <info> [1718593439.7242] ifupdown: guessed connection type (enp0s25.30) = 802-3-ethernet
Note that my install uses NetworkManager and dhclient to configure interfaces. I don't have ifupdown installed. I don't have anything configured in dhclient.conf because I assumed NetworkManager would notice the 'inet static' and use that.
Also note that I have the following set in my NetworkManager.conf:
[ifupdown]
managed=true
I can get the interface up if I manually run:
ip link add link enp0s25 name enp0s25.30 type vlan id 30
ip addr add 192.168.30.2/24 dev enp0s25.30
ip link set dev enp0s25.30 up
but of course that doesn't persist after a reboot
Any help getting this working would be appreciated.