I want to add a VLAN interface to the eth0 port of my raspberry pi. I have assigned a static IP to my physical interface eth0 and my /etc/dhcpcd.conf file looks like this:
interface eth0 static ip_address=192.168.1.2/24 static routers=192.168.1.65 static domain_name_servers= 184.108.40.206 220.127.116.11
This works perfectly fine. Now to create VLAN interface, I edited my /etc/network/interfaces file as follows:
auto eth0.2 iface eth0.2 inet manual vlan-raw-device eth0
This is how I edited the /etc/dhcpcd.conf file to assign static address:
denyinterfaces eth0 #to allow physical interface to function normally interface eth0.2 static ip_address=192.168.2.10/24 static routers=192.168.2.65 static domain_name_servers= 18.104.22.168 22.214.171.124
Now if use ip addr with rebooting first, I do not see any change to show the VLAN configuration. If I reboot, my pi doesn't connect via PuTTY over SSH and I have to start all over by rebooting my SD Card.
I want to communicate between two nodes made of a switch and 2 pis, out of which one pi would be the router and needs to have vlan to communicate with the other node. (router pis are physically connected).
Can someone please help me with this problem?