---
title: "multicast mac filtering when using macraw mode."
url: "https://maker.wiznet.io/forum/15364"
markdown_url: "https://maker.wiznet.io/forum/15364/md"
type: "Forum topic"
category: "Ethernet Chips"
author: "sambuddy200471"
created: "2024-11-25T13:35:25+09:00"
last_activity: "2024-11-28T17:00:10+09:00"
language: "en"
views: 2
replies: 1
source: "WIZnet Makers forum (https://maker.wiznet.io/forum/)"
---

# multicast mac filtering when using macraw mode.

## Question

Asked by sambuddy200471 on 2024-11-25 in Ethernet Chips.

Hello,
I am using the wiznet 6100 in macraw mode. When I initialise socket zero, I set socket zero to macraw with mac filtering and ipv6 block enabled. I leave multicast ipv4 block disabled because i need to be able to receive mDNS requests, BUT, leaving that option disabled means I receive ALOT of multicast data (which causes its own set of problems). If i enable the ipv4 multicast block, i receive no multicast data and no mDNS requests.
I have tried setting the multicast filter registers for socket zero but it seems to have no effect.
Can i use mac filtering for multicast data on socket zero when using macraw mode?
Thanks
Stuart

## Replies

### Reply 1 by sambuddy200471, 2024-11-28

Hello,

What i am trying to achieve is to run socket zero in macraw mode with hardware address filtering turned on and multicast filtering turned on

This is the code I am using to setup the multicast filter on the macraw socket.

//setup udp multicast receiver
unsigned char multicast_ip[4] ={224, 0,0,251};
unsigned char multicast_mac[6] = {0};
multicast_mac[0] = 0x01;
multicast_mac[1] = 0x00;
multicast_mac[2] = 0x5E;
multicast_mac[3] = multicast_ip[1] & 0x7F;
multicast_mac[4] = multicast_ip[2];
multicast_mac[5] = multicast_ip[3];

//unlock the chip so we can set the mac address
while (wiznetif_sysNetLockStatus())
{
ctlwizchip(CW_SYS_UNLOCK, &syslock);
}
//setSHAR(netif->hwaddr);
/* set Multicast-Group information */
setSn_DHAR(WIZNET_MACRAW_SOCKET, multicast_mac); /* set Multicast-Group H/W address */
setSn_DIPR(WIZNET_MACRAW_SOCKET, multicast_ip); /* set Multicast-Group IP address */
setSn_DPORTR(WIZNET_MACRAW_SOCKET, 5353); /* set Multicast-GroupPort number */
ctlwizchip(CW_SYS_LOCK, &syslock);

2: I can confirm that I am trying to receive ONLY mDNS traffic, specifically requests, Just so I can announce to other devices that i exist and where to find me
3: Using another socket for UDP mode for the mDNS would be a viable option as long as socket zero can stay in macraw mode AND socket zero can have multicast filtering enabled.

Thanks

---

Source: https://maker.wiznet.io/forum/15364
