The way I understand, "promiscuous mode" IS required on interfaces which should pass traffic for other MAC addresses than device's lladdr.
#Multiple passthrough mac address how to#
The netgraph interface might do what I need, but it's not yet obvious to me how to make it do that. I presume that those other multicast MAC addresses (those from IP multicast groups) don't put the interface into promiscuous mode, and I'd like to avoid it too. I want to add the multicast MAC address to the NIC without joining an IP multicast group. The FreeBSD kernel has to do the work I want it to do whenever it joins an IP multicast group (that is, it has to add a new MAC address to listen to to the NIC). It looks like all the script example really does is set up a new interface name (which I don't need) and then just puts the hardware in promiscuous mode - which is what I'm trying to avoid - sigh. This looks analogous to the netlink layer of Linux - which is also not obvious either - but on Linux there's a command on top of it which is passably easy to use. I looked over the link you cited, and the references it gives. But I don't enable promiscuous mode if I can avoid it.
#Multiple passthrough mac address code#
I use libpcap - for exactly the reasons you cite - and for portability (my code also runs on Windows!). Cisco and the IEEE did not design basic protocols that require promiscuous mode. Promiscuous mode is not required for CDP or LLDP.
I'd rather avoid it on FreeBSD just like I do on Linux. My code turns on promiscuous mode if it is unable to set up the multicast MAC addresses properly. My code listens to LLDP and CDP and avoids promiscuous mode on Linux. With modern switched networks, it is of less practical concern than it once was, but that doesn't always influence people's opinions. Promiscuous mode is strongly discouraged in many shops and in some shops disallowed completely. Using the link above, the filter runs at netgraph level (in kernel) for all traffic, where it is split on multiple ngeth interfaces, so you can run the bpf/pcap filter application with lower amounts of traffic. The only advantage is that you can have a physical interface with more than one receive channels, and a filter process running on one channel won't be able to read other channels' data.Īnyway, you can have multiple MAC addresses appearing on a single physical interface (read this thread), but you still need a low-level packet filter, bpf/pcap-style. Having the protocol LLADDR configured on the physical interface alone won't make the receiver CDPD and/or LLDP enabled, you still need to run a specific program which receive and analyze packets sent to a specific link-level address. Those packets sent to specific link addresses are received by a process, such as net-mgpd/cdpd, which runs usually in promiscuous mode. Are you sure you need to configure this kind of address on your device? For example, a CDP/LLDP-enabled device will ALWAYS send packets having the destionation MAC address set to a well-known LLADDR (01:80:c2:00:00:0e, 01:00:0c:cc:cc:cc and so on), regardless of the configuration on the other side of the link. + !pci_is_thunderbolt_attached(to_pci_dev(ndev->dev.There is one question about your requirement. + if (ndev->dev.parent & dev_is_pci(ndev->dev.parent) & Mac_obj_name = -1662,6 +1664,19 static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa) #include -1605,6 +1606,7 static int vendor_mac_passthru_addr_read(struct r8152 *tp, struct sockaddr *sa) Skip builtin PCI MAC address which is share MAC address withįixes: f77b83b5bbab ("net: usb: r8152: Add MAC passthrough support forĭrivers/net/usb/r8152.c | 15 +++++++++++++++ĭiff -git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c Or USB hub, MAC passthrough address from BIOS should beĬhecked if it had been used to avoid using on other dongles.Ĭurrently builtin r8152 on Dock still can't be identified.įirst detected r8152 will use the MAC passthrough address. When plugin multiple r8152 ethernet dongles to Lenovo Docks Next in thread: Aaron Ma: " net: usb: r8152: Set probe mode to sync".Previous message: Greg Kroah-Hartman: "Re: dma-buf: Move sysfs work out of DMA-BUF export/release path".Next message: Aaron Ma: " net: usb: r8152: Set probe mode to sync".Linux-Kernel Archive: net: usb: r8152: Check used MAC passthrough address net: usb: r8152: Check used MAC passthrough address From: Aaron Ma