I have CentOS 6.8 running in a Parallels VM. eth0 is bridged to the Ethernet adapter in the Mac. I need the CentOS server running a specific VLAN (10), so I have read this RHEL documentation.
eth0 pulls a DHCP address (for the moment) and I can ping the equipment on the untagged network OK from within the VM. I have tried the following with eth0 set static and not assigning it an address, but without a difference for the VLAN accessibility.
However, when I setup an ifcfg-eth0.10 with
VLAN=yes DEVICE=eth0.10 BOOTPROTO=static ONBOOT=yes IPADDR=10.10.2.10 NETMASK=255.255.0.0
I am unable to ping anything on VLAN 10, including other virtual interfaces on the Mac host. If, however, I do this (as documented here):
ip link add link eth0 name eth0.10 type vlan id 10
ip addr add 10.10.2.10 dev eth0.10
I am immediately able to use the interface as expected. That's great! But I need the VLAN interface to persist after a restart. What am I doing wrong?