On Tue, Mar 14, 2023 at 12:25:18PM -0700, Richard Cochran wrote: > On Tue, Mar 14, 2023 at 12:38:06PM +0200, Kamil Zaripov wrote: > > Can you explain the problems you see with timestamping in the interface on > > top of a bridge? > > When a MAC joins a bridge, the MAC is no longer avaiable as a network > interface. This is how the bridge thing is implemented in Linux.
That is approximately true (by default), but with your permission, some nuance might help. The bridge driver has an rx_handler which steals all traffic from the bridge ports, so it can be processed by sockets opened on the bridge device itself. The exception is link-local multicast traffic (this is why L2 PTP works over sockets opened on bridge ports, or at least with gPTP it does, where all traffic is in the reserved 01-80-c2-00-00-xx space), but it's also possible to add netfilter rules to tell the bridge to stop stealing other traffic flows, such that those remain visible to sockets opened on the bridge ports rather than on the bridge itself. I happened to have these commands sitting around in a drawer, tailored particularly to running PTP over bridge ports. Some adjustments might be necessary depending on distribution and kernel config options. # PTP over L2 /sbin/ebtables --table broute --append BROUTING --protocol 0x88F7 --jump DROP # PTP over IPv4 /sbin/ebtables --table broute --append BROUTING --protocol 0x0800 --ip-protocol udp --ip-destination-port 320 --jump DROP /sbin/ebtables --table broute --append BROUTING --protocol 0x0800 --ip-protocol udp --ip-destination-port 319 --jump DROP # PTP over IPv6 /sbin/ebtables --table broute --append BROUTING --protocol 0x86DD --ip6-protocol udp --ip6-destination-port 320 --jump DROP /sbin/ebtables --table broute --append BROUTING --protocol 0x86DD --ip6-protocol udp --ip6-destination-port 319 --jump DROP _______________________________________________ Linuxptp-devel mailing list Linuxptp-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linuxptp-devel