Configure VLAN Raspberry PI 4

I have flashed my Raspberry PI 4 to run OpenWRT.

I have configured the LAN and WAN connections. I want to create a separate subnet for my servers.
I tried using the wiki and came up with the below settings. The issue is when i try setting the IP address in the server , it is not resolving any connection to the Router or internet.
Currently when i ping the interface from my host it works as shown below
2020-06-04 22_59_58-Window

/etc/config/network

config interface 'loopback'
        option ifname 'lo'
        option proto 'static'
        option ipaddr '127.0.0.1'
        option netmask '255.0.0.0'

config globals 'globals'
        option ula_prefix 'fd2c:576a:a0b1::/48'

config interface 'lan'
        option type 'bridge'
        option ifname 'eth0'
        option proto 'static'
        option ipaddr '192.168.1.1'
        option netmask '255.255.255.0'
        option delegate '0'

config interface 'WAN'
        option proto 'pppoe'
        option ifname 'eth1'
        option username 'XXXXXXX'
        option password 'XXXXXXX'
        option keepalive '0'
        option delegate '0'
        option ipv6 '0'

config interface 'lan2'
        option type 'bridge'
        option proto 'static'
        option netmask '255.255.255.0'
        option ip6assign '60'
        option ifname 'eth0.2'
        option ipaddr '192.168.2.1'

Configuration

  1. See switch configuration in LuCI.
  2. Give total /etc/config/network, does it contain switch section?

The RPi4 doesn't have a switch.

How are the devices connected to the RPi4? Directly? Managed switch? How are they obtaining an IP?

1 Like

Create vlans on the built in Ethernet with eth0.1 eth0.2 etc. Once you start doing that, all packets must be tagged. It does not work to leave anything attached to "plain" eth0 and try to mix tagged and untagged on the same cable.

3 Likes

The devices are connected via unmanaged switch
https://www.amazon.ae/gp/product/B00A128S24/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1

They are obtaining IP from the DHCP server on the Raspberry Pi 4

How do I create vlans on the built in Ethernet with eth0.1 eth0.2? and how do i tag them?

Tagged VLANs require a (at least smart-)managed switch to be processed correctly. How unmanaged switches deal with tagged packets is undefined, they may let them pass, drop them randomly or serve them as a dog's dinner.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.