troglobit / smcroute

Static multicast routing for UNIX
https://troglobit.com/projects/smcroute/
GNU General Public License v2.0
242 stars 62 forks source link

can't add mroute via smcroutectl add #193

Closed UrusovVladimir closed 1 year ago

UrusovVladimir commented 1 year ago

Hi there! I need any help. I use 2 routers with Entware project. I installed package smcroute, but I can't force it work. scheme: DLNA server(connect to R1 by wired)->br0(eth2.1 and AccessPoint0)->R1->nwg0(wireguard interface)<------->nwg0(wireguard interface)->R2->br0->host connect on wifi(dlna client)

config R1:

phyint br0 enable
phyint nwg0 enable
mgroup from br0 group 239.255.255.250
mgroup from nwg0 group 239.255.255.250
mroute from br0 group 239.255.255.250 to nwg0
mroute from nwg0 group 239.255.255.250 to br0

config R2:

phyint br0 enable
phyint nwg0 enable
mgroup from br0 group 239.255.255.250
mgroup from nwg0 group 239.255.255.250
mroute from br0 group 239.255.255.250 to nwg0
mroute from nwg0 group 239.255.255.250 to br0

smcroute enable, i see in ps: / # ps | grep smc 1420 root 2548 S smcrouted

But if i use command smcroutectl show,I can't see anything. As well as: / # smcroutectl show routes / # Command smcroutectl show groups:

/ # smcroutectl show groups

Group Memberships Table
GROUP (S,G)                                IIF
(*, 239.255.255.250)                       br0
(*, 239.255.255.250)                       nwg0

When i start app for dlna by my phone, this scheme doesn't work( I see ssdp a packet on interface br0 R1, from my phone, but i can't see forwards between br0 to nwg0 ssdp of the packet

If I try use command smcroutectl add, I see this error: / # smcroutectl add nwg0 239.255.255.250 br0 smcroutectl: ipc: mroute: inbound nwg0 is not a known phyint

Where am I wrong?

UrusovVladimir commented 1 year ago

Also i use rules s in iptables on both sides iptables -t mangle -A PREROUTING -i br0 -d 239.255.255.250 -j TTL --ttl-inc 1

troglobit commented 1 year ago

Super difficult to help debug your system remotely. Here are a few things that would be good to start with:

  1. which version of smcroute are you using (I'm not affiliated with Entware so I don't know what they've packaged)
  2. does all interfaces have the MULTICAST flag set?
  3. can you see the interfaces be enumerated in the file /proc/net/ip_mr_vif on both routers?
UrusovVladimir commented 1 year ago

Hi @troglobit. Thank you for your quick response. I can give your access for my routers. 1)/ # smcroutectl version SMCRoute v2.5.5 Bug report address: https://github.com/troglobit/smcroute/issues Project homepage: https://troglobit.com/smcroute.html 2)ifconfig:

nwg0      Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:10.66.64.1  P-t-P:10.66.64.1  Mask:255.255.255.0
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1324  Metric:1
          RX packets:789 errors:0 dropped:0 overruns:0 frame:0
          TX packets:137 errors:2 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:50
          RX bytes:41980 (40.9 KiB)  TX bytes:12552 (12.2 KiB)

br0       Link encap:Ethernet  HWaddr 50:FF:20:4E:BD:46
          inet addr:172.16.137.1  Bcast:172.16.137.255  Mask:255.255.255.0
          inet6 addr: 2a02:290:2:64c:52ff:20ff:fe4e:bd46/128 Scope:Global
          inet6 addr: fe80::52ff:20ff:fe4e:bd46/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:22409 errors:0 dropped:0 overruns:0 frame:0
          TX packets:83466 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:4224232 (4.0 MiB)  TX bytes:19303719 (18.4 MiB)

3)I can see only br0 in file: R1: / # cat /proc/net/ip_mr_vif Interface BytesIn PktsIn BytesOut PktsOut Flags Local Remote 0 eth3 10752 336 0 0 00008 0000000B 00000000 1 br0 0 0 0 0 00008 0000001F 00000000 R2: / # cat /proc/net/ip_mr_vif Interface BytesIn PktsIn BytesOut PktsOut Flags Local Remote 0 eth2.2 0 0 0 0 00008 0000001A 00000000 1 br0 0 0 0 0 00008 0000001C 00000000

troglobit commented 1 year ago

OK, so the problem seems to be that smcrouted failed to enumerate the nwg0 interface, otherwise it would be listed in ip_mr_vif. Not sure why, but it should be shown in the syslog. You can run the daemon with debug log level to get some more output in the log when it starts up.

I've never tested with a wireguard tunnel interface before, or any p-t-p interface for that matter. It is likely you'll have to workaround the issue by using a GRE tunnel over nwg0.

UrusovVladimir commented 1 year ago

How can I do it? smcrouted -l debug ?

UrusovVladimir commented 1 year ago

I used this manual for help in setting https://an0n-r0.medium.com/making-dlna-through-site-to-site-vpn-work-f393629f4ce0

troglobit commented 1 year ago

Here's the HTML version of the manual page I distributed with SMCRoute, hopefully that helps. https://man.troglobit.com/man8/smcrouted.8.html

Like I said, I've never tested running over a wireguard tunnel. Glad to see someone got it working. The real problem here is that smcrouted fails to enumerate the interface as a multicast VIF in the kernel. Only way to debug that is to get some more logs from the daemon and then drill down from there.

UrusovVladimir commented 1 year ago

Thank you so much!I will try to get debug log

UrusovVladimir commented 1 year ago

@troglobit I get debug log, but i don't see, the deamon is started if look in ps | grep smc the deamon is running 9242 root 2548 S smcrouted -s -l debug

/ # cat /opt/var/log/syslog Feb 9 23:59:23 Keenetic-7124 syslog.info syslogd started: BusyBox v1.35.0 Feb 10 00:01:07 Keenetic-7124 daemon.notice smcroute[9242]: SMCRoute v2.5.5 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface lo, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface tunl0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface sit0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface gre0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface gretap0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ethoip0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface dummy0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ip6tnl0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ezcfg0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface eth2, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface eth3, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra1, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra2, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra3, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra4, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra5, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra6, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra7, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra8, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra9, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface apcli0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface apcli1, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ntce0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface sstp-bridge, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface sstp-br-link, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface sstp-peer-link, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface dsl_br0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface eth2.1, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface eth2.3, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface br0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface br1, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ovpn_br0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ovpn_br1, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface nwg0, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra9.1, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra4.1, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra9.2, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found new interface ra4.2, adding ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found lo, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Removing multicast VIFs for lo Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ezcfg0, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found eth3, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found br0, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found br1, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found nwg0, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found lo, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Removing multicast VIFs for lo Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found eth2, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found eth3, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found eth3, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ra0, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ra4, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ra5, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ra9, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ntce0, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Removing multicast VIFs for ntce0 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found eth2.1, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found eth2.3, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found br0, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found br0, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ra9.1, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ra4.1, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ra9.2, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found ra4.2, updating ... Feb 10 00:01:07 Keenetic-7124 daemon.err smcroute[9242]: IPv4 multicast routing API already in use: Address already in use Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: NOFILE: current 1024 max 4096 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: NOFILE: set new current 4096 max 4096 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Binding IPC socket to /opt/var/run/smcroute.sock Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 1: # Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 2: # smcroute.conf example Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 3: # Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 4: # The configuration file supports joining multicast groups, to use Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 5: # Layer-2 signaling so that switches and routers open up multicast Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 6: # traffic to your interfaces. Leave is not supported, remove the Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 7: # mgroup and SIGHUP your daemon, or send a specific leave command. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 8: # Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 9: # NOTE: Use of the mgroup command should be avoided if possible. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 10: # Instead configure "router ports" or similar on the switches Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 11: # or bridges on your LAN. This to have them direct all the Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 12: # multicast to your router, or select groups if they have Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 13: # such capabilities. Usually MAC multicast filters exist. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 14: # Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 15: # Some switch manufacturers support mrdisc, RFC4286, which Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 16: # SMCRoute can use to advertise itself on source interfaces. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 17: # If availble, use that instead of mgroup. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 18: # Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 19: # Similarly supported is setting mroutes. Removing mroutes is not Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 20: # supported, remove/comment out the mroute from the .conf file, or Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 21: # send a remove command with smcroutectl. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 22: # Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 23: # Syntax: Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 24: # phyint IFNAME <enable|disable> [mrdisc] [ttl-threshold <1-255>] Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 25: # mgroup from IIF [source ADDR[/LEN]] group GROUP[/LEN] Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 26: # mroute from IIF [source ADDR[/LEN]] group GROUP[/LEN] to OIF [OIF ...] Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 27: # include /path/to/.conf Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 28: Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 29: # This example assumes smcrouted was started with the -N flag. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 30: # Only enable interfaces required for inbound and outbound traffic. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 31: phyint br0 enable Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Creating/updating multicast VIF for br0 TTL 1 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: No IPv4 multicast socket Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: No IPv6 multicast socket Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 32: phyint nwg0 enable Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Creating/updating multicast VIF for nwg0 TTL 1 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: No IPv4 multicast socket Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: No IPv6 multicast socket Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 33: #phyint eth2 enable ttl-threshold 5 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 34: #phyint virbr0 enable ttl-threshold 5 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 35: Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 36: # Instruct the kernel to join the multicast group 225.1.2.3 on interface Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 37: # eth0. Then add an mroute of the same multicast stream, from the host Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 38: # 192.168.1.42 on interface eth0 and forward to eth1 and eth2. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 39: #mgroup from eth0 group 225.1.2.3 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 40: #mroute from eth0 source 192.168.1.42 group 225.1.2.3 to eth1 eth2 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 41: mgroup from br0 group 239.255.255.250 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Group socket 8 count 1 of MAX 20 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Join group (,239.255.255.250) on ifindex 31 and socket 8 ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 42: mgroup from nwg0 group 239.255.255.250 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Group socket 8 count 2 of MAX 20 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Join group (,239.255.255.250) on ifindex 35 and socket 8 ... Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 43: mroute from br0 group 239.255.255.250 to nwg0 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 43: mroute: checking for input iface br0 ... Feb 10 00:01:07 Keenetic-7124 daemon.warn smcroute[9242]: /opt/etc/smcroute.conf line 43: mroute: inbound br0 is not a known phyint Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 44: mroute from nwg0 group 239.255.255.250 to br0 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 44: mroute: checking for input iface nwg0 ... Feb 10 00:01:07 Keenetic-7124 daemon.warn smcroute[9242]: /opt/etc/smcroute.conf line 44: mroute: inbound nwg0 is not a known phyint Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 45: Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 46: # Similar example, but using source-specific group join Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 47: #mgroup from virbr0 source 192.168.123.110 group 225.1.2.4 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 48: #mroute from virbr0 source 192.168.123.110 group 225.1.2.4 to eth0 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 49: Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 50: # Allow multicast for group 225.3.2.1, from ANY source, ingressing on Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 51: # interface eth0 to be forwarded to eth1 and eth2. When the kernel Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 52: # receives a frame from unknown multicast sender, it asks smcrouted who Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 53: # use this "template" to match against, if the ingressing interface and Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 54: # group matches, smcrouted installs an (S,G) route in the kernel MFC. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 55: #mgroup from eth0 group 225.3.2.1 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 56: #mroute from eth0 group 225.3.2.1 to eth1 eth2 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 57: Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 58: # The previous is an example of the (,G) support. It is also possible Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 59: # to specify a range of such rules. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 60: #mgroup from eth0 group 225.0.0.0/24 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 61: #mroute from eth0 group 225.0.0.0/24 to eth1 eth2 Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 62: Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 63: # Include any snippet in /etc/smcroute.d/, but please remember that Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 64: # all phyint statements must be read first. Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: /opt/etc/smcroute.conf line 65: include /etc/smcroute.d/.conf Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Found include --> /etc/smcroute.d/.conf Feb 10 00:01:07 Keenetic-7124 daemon.warn smcroute[9242]: Parse error in /opt/etc/smcroute.conf Feb 10 00:01:07 Keenetic-7124 daemon.debug smcroute[9242]: Creating PID file /opt/var/run/smcroute.pid Feb 10 00:01:07 Keenetic-7124 daemon.notice smcroute[9242]: Ready, waiting for client request or kernel event. Feb 10 00:02:07 Keenetic-7124 daemon.info smcroute[9242]: Cache timeout, flushing unused (,G) routes! Feb 10 00:03:07 Keenetic-7124 daemon.info smcroute[9242]: Cache timeout, flushing unused (,G) routes! Feb 10 00:04:07 Keenetic-7124 daemon.info smcroute[9242]: Cache timeout, flushing unused (*,G) routes! Feb 10 00:04:21 Keenetic-7124 daemon.debug smcroute[9242]: ipc: mroute: checking for input iface nwg0 ... Feb 10 00:04:21 Keenetic-7124 daemon.warn smcroute[9242]: ipc: mroute: inbound nwg0 is not a known phyint

UrusovVladimir commented 1 year ago

Maybe it doesn't work because there are a lot of interfaces in the system? / # smcroutectl show interface INDEX PHYINT VIF MIF 1 lo N/A N/A 2 tunl0 N/A N/A 3 sit0 N/A N/A 4 gre0 N/A N/A 5 gretap0 N/A N/A 6 ethoip0 N/A N/A 7 dummy0 N/A N/A 8 ip6tnl0 N/A N/A 9 ezcfg0 N/A N/A 10 eth2 N/A N/A 11 eth3 N/A N/A 12 ra0 N/A N/A 13 ra1 N/A N/A 14 ra2 N/A N/A 15 ra3 N/A N/A 16 ra4 N/A N/A 17 ra5 N/A N/A 18 ra6 N/A N/A 19 ra7 N/A N/A 20 ra8 N/A N/A 21 ra9 N/A N/A 22 apcli0 N/A N/A 23 apcli1 N/A N/A 24 ntce0 N/A N/A 25 sstp-bridge N/A N/A 26 sstp-br-link N/A N/A 27 sstp-peer-link N/A N/A 28 dsl_br0 N/A N/A 29 eth2.1 N/A N/A 30 eth2.3 N/A N/A 31 br0 N/A N/A 32 br1 N/A N/A 33 ovpn_br0 N/A N/A 34 ovpn_br1 N/A N/A 35 nwg0 N/A N/A 36 ra9.1 N/A N/A 37 ra4.1 N/A N/A 38 ra9.2 N/A N/A 39 ra4.2 N/A N/A

troglobit commented 1 year ago

Hmm, yeah that's a possibility. Linux only supports 32 VIFs (it's being worked on). So try starting with smcrouted -N (plus any other args you need). Then it is super important you have the phyint foo enable line in your .conf file!

UrusovVladimir commented 1 year ago

Could you please tell me what is foo? I can't find description in internet:)

troglobit commented 1 year ago

foo is a generic name. Used in computer science and elsewhere to signify "any". Compare with the configuration you posted initially;

phyint br0 enable
phyint nwg0 enable
...

Other common "any" names are; bar, baz, quz, xyzzy ... for more information see https://www.rfc-editor.org/rfc/rfc3092

UrusovVladimir commented 1 year ago

@troglobit Thanks. I have in my configuration interfaces nwg0 and br0 on both sides.

I changed my config, now it looks like that / # cat /opt/etc/smcroute.conf phyint br0 enable phyint nwg0 enable mgroup from br0 group 239.255.255.250 mgroup from nwg0 group 239.255.255.250 mroute from br0 group 239.255.255.250 to nwg0 mroute from nwg0 group 239.255.255.250 to br0

include /etc/smcroute.d/*.conf But it doesn't solve my problem(

Feb 10 10:15:10 Keenetic-7124 daemon.err smcroute[21342]: IPv4 multicast routing API already in use: Address already in use
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: NOFILE: current 1024 max 4096
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: NOFILE: set new current 4096 max 4096
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: Binding IPC socket to /opt/var/run/smcroute.sock
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 1: phyint br0 enable
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: Creating/updating multicast VIF for br0 TTL 1
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: No IPv4 multicast socket
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: No IPv6 multicast socket
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 2: phyint nwg0 enable
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: Creating/updating multicast VIF for nwg0 TTL 1
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: No IPv4 multicast socket
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: No IPv6 multicast socket
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 3: mgroup from br0 group 239.255.255.250
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: Group socket 8 count 1 of MAX 20
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: Join group (*,239.255.255.250) on ifindex 31 and socket 8 ...
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 4: mgroup from nwg0 group 239.255.255.250
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: Group socket 8 count 2 of MAX 20
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: Join group (*,239.255.255.250) on ifindex 35 and socket 8 ...
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 5: mroute from br0 group 239.255.255.250 to nwg0
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 5: mroute: checking for input iface br0 ...
Feb 10 10:15:10 Keenetic-7124 daemon.warn smcroute[21342]: /opt/etc/smcroute.conf line 5: mroute: inbound br0 is not a known phyint
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 6: mroute from nwg0 group 239.255.255.250 to br0
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 6: mroute: checking for input iface nwg0 ...
Feb 10 10:15:10 Keenetic-7124 daemon.warn smcroute[21342]: /opt/etc/smcroute.conf line 6: mroute: inbound nwg0 is not a known phyint
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 7:
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 8:
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: /opt/etc/smcroute.conf line 9: include /etc/smcroute.d/*.conf
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: Found include --> /etc/smcroute.d/*.conf
Feb 10 10:15:10 Keenetic-7124 daemon.warn smcroute[21342]: Parse error in /opt/etc/smcroute.conf
Feb 10 10:15:10 Keenetic-7124 daemon.debug smcroute[21342]: Creating PID file /opt/var/run/smcroute.pid
Feb 10 10:15:10 Keenetic-7124 daemon.notice smcroute[21342]: Ready, waiting for client request or kernel event.

I don't like this line: Pv4 multicast routing API already in use: Address already in use

troglobit commented 1 year ago

It means you have another multicast routing daemon running already. Possibly a previous instance of smcrouted. Only one can run at the same time by default due to a kernel limitation.

UrusovVladimir commented 1 year ago

I think maybe this problem that any deamon use address 239.255.255.250?

UrusovVladimir commented 1 year ago

I check it

UrusovVladimir commented 1 year ago

I checked all system, deleted upnp,dlna and igmp proxy components, and that's what i see. I think that the problem with starting the daemon was solved. But could you please tell me, this line bad or may i ignore it?(Feb 10 11:01:24 Keenetic-1605 daemon.err smcroute[1122]: Failed enabling PIM IGMPMSG_WRONGVIF, ignoring: Protocol not available)

Feb 10 11:01:24 Keenetic-1605 daemon.err smcroute[1122]: Failed enabling PIM IGMPMSG_WRONGVIF, ignoring: Protocol not available
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: NOFILE: current 1024 max 4096
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: NOFILE: set new current 4096 max 4096
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Binding IPC socket to /opt/var/run/smcroute.sock
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 1: phyint br0 enable
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Creating/updating multicast VIF for br0 TTL 1
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Map iface br0              => VIF 0  ifindex 28 flags 0x0008 TTL threshold 1
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Map iface br0              => MIF 0  ifindex 28 flags 0x0000 TTL threshold 1
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 2: phyint nwg0 enable
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Creating/updating multicast VIF for nwg0 TTL 1
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Map iface nwg0             => VIF 1  ifindex 30 flags 0x0008 TTL threshold 1
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Map iface nwg0             => MIF 1  ifindex 30 flags 0x0000 TTL threshold 1
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 3: mgroup from br0 group 239.255.255.250
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Group socket 10 count 1 of MAX 20
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Join group (*,239.255.255.250) on ifindex 28 and socket 10 ...
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 4: mgroup from nwg0 group 239.255.255.250
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Group socket 10 count 2 of MAX 20
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Join group (*,239.255.255.250) on ifindex 30 and socket 10 ...
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 5: mroute from br0 group 239.255.255.250 to nwg0
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 5: mroute: checking for input iface br0 ...
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 5: mroute: input iface br0 has vif 0
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 5: mroute: checking for nwg0 ...
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: mroute: adding route from br0 (0.0.0.0/32,239.255.255.250/32)
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 6: mroute from nwg0 group 239.255.255.250 to br0
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 6: mroute: checking for input iface nwg0 ...
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 6: mroute: input iface nwg0 has vif 1
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 6: mroute: checking for br0 ...
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: mroute: adding route from nwg0 (0.0.0.0/32,239.255.255.250/32)
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 7:
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: /opt/etc/smcroute.conf line 8: include /etc/smcroute.d/*.conf
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Found include --> /etc/smcroute.d/*.conf
Feb 10 11:01:24 Keenetic-1605 daemon.debug smcroute[1122]: Creating PID file /opt/var/run/smcroute.pid
Feb 10 11:01:24 Keenetic-1605 daemon.notice smcroute[1122]: Ready, waiting for client request or kernel event.
UrusovVladimir commented 1 year ago

I understood one thing, smcroute didn't start if in my system use igmp-proxy module

troglobit commented 1 year ago

The igmp-proxy project is actually a multicast router

troglobit commented 1 year ago

Smcroute has the support for detecting the source ip of the sender using that PIM mechanism. Your kernel does not seem to support it.

So you need to set the sender ip in your routes.

UrusovVladimir commented 1 year ago

Must i add in my config this settings?: R1 mroute from br0 172.16.137.0/24 group 239.255.255.250 to nwg0 mroute from nwg0 192.168.1.0/24 group 239.255.255.250 to br0 R2 mroute from br0 192.168.1.0/24 group 239.255.255.250 to nwg0 mroute from nwg0 172.16.137.0/24 group 239.255.255.250 to br0 R1=DLNA server local network 172.16.137.0/24 R2=Client DLNA local network 192.168.1.0/24 Could you tell me, i think correctly?

UrusovVladimir commented 1 year ago

Now i see ssdp on wg interfaces but not on br0 interfaces in tcpdump

R1:
/ # smcroutectl show

(*,G) Template Rules
ROUTE (S,G)                                IIF             OIFS
(*, 239.255.255.250)                       br0             nwg0
(*, 239.255.255.250)                       nwg0            br0

Kernel MFC Table
ROUTE (S,G)                                IIF             OIFS
(172.16.137.2, 239.255.255.250)            br0             nwg0
(172.16.137.1, 239.255.255.250)            br0             nwg0
(172.16.137.149, 239.255.255.250)          br0             nwg0
(192.168.1.75, 239.255.255.250)            nwg0            br0
(192.168.1.104, 239.255.255.250)           nwg0            br0

R2:
/ # smcroutectl show

(*,G) Template Rules
ROUTE (S,G)                                IIF             OIFS
(*, 239.255.255.250)                       br0             nwg0
(*, 239.255.255.250)                       nwg0            br0

Kernel MFC Table
ROUTE (S,G)                                IIF             OIFS
(172.16.137.2, 239.255.255.250)            nwg0            br0
(172.16.137.1, 239.255.255.250)            nwg0            br0
(192.168.1.75, 239.255.255.250)            br0             nwg0
(172.16.137.149, 239.255.255.250)          nwg0            br0
(192.168.1.104, 239.255.255.250)           br0             nwg0

172.16.137.2 dlna server 192.168.1.104 client dlna

UrusovVladimir commented 1 year ago

wooooo!!!! It's WORKED =) Thank you so much, for your help! I will write how I setup it a little bit later!

troglobit commented 1 year ago

Great, I'll convert this from an issue to discussion then.