Issue in reaching two device with same mac connected to different VLAN

Hi Mates,

Recently I've been undergoing a POC activity with a Topology mentioned below.

ONSU_STNC-ITERIS (2)

Let me give a summary of the setup shortly,

  • The Router is running OpenWRT SDK(19.07)
  • The Router has only two ethernet interfaces(eth0--> for wan, eth1--> for lan).
  • eth1.2 and eth1.4 are two vlan(having DHCP server each) created from the link eth1.
  • The client-1 is tagged with vlan_id: 2 and the client-2 is tagged with vlan_id: 4

The actual use case of this POC is,
The clients(client-1 and client-2) should get IP from different VLAN networks under the same phy link and the clients should be reachable between each other.

The Issue which I observe is,

  • I could get IP for each client.
  • From the Router, I could ping Client-1(no loss)
  • From the Router, I could not ping Client-2(heavy loss)
  • Client-1 to Client-2 is also not reachable.

I know that this case is against the L2 functionality, But is there any way that I could achieve this functionality?

Attaching my configuration file for reference,

/etc/config/network

config interface 'eth0'
        option ifname 'eth0'
        option ip6assign '60'
        option proto 'dhcp'
        option macaddr 'd8:e9:a2:bb:ef:11'

config interface 'vlan2'
        option ifname 'eth1.2'
        option proto 'static'
        option ipaddr '192.168.2.1'
        option netmask '255.255.255.0'

config interface 'vlan4'
        option ifname 'eth1.4'
        option proto 'static'
        option ipaddr '192.168.4.1'
        option netmask '255.255.255.0'

/etc/config/dhcp

config dhcp 'lan2'                               
        option interface 'vlan2'                 
        option start '192.168.2.2'             
        option limit '1'                         
        option leasetime '12h'                   
        option force '1'                         
        option dhcpv6 'server'                   
        option ra 'server'                       
                                                 
config dhcp 'lan4'                               
        option interface 'vlan4'                 
        option start '192.168.4.2'
        option limit '1'            
        option leasetime '12h'      
        option force '1'            
        option dhcpv6 'server'      
        option ra 'server'

/etc/config/firewall

config zone                                     
        option name 'Lap1'                                 
        option input 'ACCEPT'                    
        option forward 'ACCEPT'                            
        list network 'vlan2'
        list network 'vlan4'                    
        option output 'ACCEPT'

Thanks and Appreciating your support in advance.

MAC addresses are supposed to be unique in the entire world, you must fix this.

3 Likes

Give the devices different mac addresses?

2 Likes

With Different mac, everything seems to be working fine.
My use case is with the same mac. :slight_smile:

1 Like

So you want a broken setup?

1 Like

TBH, yes!!

Well done, you've achieved that then. What further do you want from us?

1 Like

I need to analyze where exactly the packet is getting dropped when pinging the client from the router.
Moreover, Since I have connected my clients in different VLAN network, I believe the forwarding should happen and the clients should get pinged?

Not sure what any of that has to do with OpenWRT? You've got a broken setup. It's not going to work as long as the devices are using the same MAC address. It's not an OpenWRT issue.

2 Likes

Yes, its not an openwrt issue.
I was just anticipating some ideas to make this work!:slight_smile:

Stop using the same MAC address for both devices. That's how you make it work. Or you can not do that and it won't work. Your choice.

2 Likes

This does not work, because no sane implementation of the ARP is going to consider the case of two devices with the same address, because the standard says that no such thing can happen.

There is one single ARP table, where each MAC address can only appear once; two devices with the same address are going to fight with each other for a position in that list.

Fix the MAC address from one of the devices, or dig into the kernel and change the ARP implementation. Is there a real use case behind this post? Or are you just trying to waste some time?

3 Likes

This POC is been under experiment for a demo use case.
Any ways, Let me dig into the kernel and play with ARP for any solution.

You have not said anything about the switch-- obviously it needs to be VLAN-aware and properly configured to strictly separate the two VLANs. Even at that it may become confused by duplicate MACs, as that is something that was never intended to work.

4 Likes