0

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= 8.8.8.8 8.8.4.4

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= 8.8.8.8 8.8.4.4

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?

  • Does your managed switch supports VLAN? – Ingo Jul 28 '18 at 19:00
0

You are ignoring the warning in /etc/network/interfaces # Please note that this file is written to be used with dhcpcd # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

You are attempting to use 2 incompatible network managers - which won't work.

It is unclear what you are attempting to achieve or whether using virtual interfaces will help.

  • Could you please elaborate on that? I am fairly new with using raspberry pis. 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). – Doe.John May 2 '18 at 14:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.