A router with multicast routing enabled will have its LAN interface configured to listen for the multicast groups it intends to serve. This is time when using a mask with multicast actually means something. Multicast groups are individual addresses, so a mask is normally meaningless, but you can use a mask to specify a range of addresses for the router, e.g. 239.0.0.0/8
.
I think you are also missing that besides PIM, or whichever multicast routing protocol you use, the router will also use IGMP on the LAN (or the old Cisco CGMP). IGMP is the protocol between the multicast hosts and the multicast router. IGMP is used to tell the multicast router that a host is interested in listening to a multicast group, and the router also uses IGMP to see if hosts are still interested in the group traffic, otherwise it stops routing it.
Many people now think IGMP is used for switches, but that is not its purpose. Most modern business switches can eavesdrop on the IGMP messages between the hosts and router (IGMP snooping) to tailor which interfaces receive which multicast traffic. Originally, switches would send all multicast traffic to all switch interfaces, but that is wasteful of link bandwidth, and IGMP snooping is a refinement.
