troglobit / pimd

PIM-SM/SSM multicast routing for UNIX and Linux
http://troglobit.com/projects/pimd/
BSD 3-Clause "New" or "Revised" License
194 stars 86 forks source link

pimd fails to start on OpenBSD 6.0-i386: "Cannot set PIM flag in kernel" #111

Closed tmo-github closed 6 years ago

tmo-github commented 6 years ago

I am trying to run pimd on an OpenBSD 6.0 server (i386 platform).

I could build pimd, but when I am trying to launch it, it exists on an error:

debug level 0xffffffff (dvmrp_detail,dvmrp_prunes,dvmrp_routes,dvmrp_neighbors,dvmrp_timers,igmp_proto,igmp_timers,igmp_members,trace,timeout,packets,interfaces,kernel,cache,rsrr,pim_detail,pim_hello,pim_register,pim_join_prune,pim_bootstrap,pim_asserts,pim_cand_rp,pim_routes,pim_timers,pim_rpf)
17:11:54.430 pimd version 2.3.2 starting ...
17:11:54.433 Got 262144 byte send buffer size in 0 iterations
17:11:54.433 Got 262144 byte recv buffer size in 0 iterations
17:11:54.434 Got 262144 byte send buffer size in 0 iterations
17:11:54.434 Got 262144 byte recv buffer size in 0 iterations
17:11:54.435 Getting vifs from kernel
17:11:54.436 Installing vr0 (xxx.xxx.xxx.xxx on subnet xxx.xxx.xxx/xx) as vif #0 - rate 0
17:11:54.436 Installing vr1 (192.168.2.1 on subnet 192.168.2) as vif #1 - rate 0
17:11:54.437 Installing vr2 (192.168.1.1 on subnet 192.168.1) as vif #2 - rate 0
17:11:54.437 Getting vifs from /etc/pimd.conf
17:11:54.438 Local Cand-BSR address 192.168.2.1, priority 5
17:11:54.438 Local Cand-RP address 192.168.2.1, priority 20, interval 30 sec
17:11:54.439 spt-threshold packets 0 interval 100
17:11:54.439 Local static RP: 169.254.0.1, group 232.0.0.0/8
17:11:54.440 IGMP query interval  : 12 sec
17:11:54.440 IGMP querier timeout : 41 sec
17:11:54.440 Cannot set PIM flag in kernel: m
troglobit commented 6 years ago

You need to enable multicast forwarding in the kernel, it is disabled by default.

I wrote a howto on this a few years back. It differs a bit between the BSD's, and maybe the OpenBSD people have changed it since last I tried.

http://troglobit.com/howto-run-pimd-on-openbsd.html

tmo-github commented 6 years ago

I guess I had that part correctly set before to try to run pimd:

In /etc/sysctl.conf , I have: net.inet.ip.forwarding=1 net.inet.ip.mforwarding=1

And in /etc/rc.conf.local, I have: multicast=YES (this single line seems to replace the 2 lines present in earlier versions of OpenBSD you mention in your HOWTO)

The full error from /var/log/messages: Cannot set PIM flag in kernel: Protocol not available

troglobit commented 6 years ago

Seems your kernel doesn't have multicast support compiled in then? My knowledge of the BSD's is quite limited I'm afraid, but it surely looks like the PIM/MROUTED/MROUTING support is missing from your kernel.

On FreeBSD I had to change the boot loader to load the correct module, http://troglobit.com/howto-run-pimd-on-freebsd.html

Sorry I cannot help you more than this.

tmo-github commented 6 years ago

Thanks for your quick feedback.

You were right. I got confused by the fact that MROUTING is enabled by default in OpenBSD, thought this was it, and failed to see that there is another kernel option specifically for 'PIM' which is disabled by default. (See http://man.openbsd.org/OpenBSD-6.0/pim.4#SYNOPSIS )

I have now recompiled the kernel with 'OPTION PIM' and it works fine afterwards.

troglobit commented 6 years ago

Great to hear you got it working!

Admittedly, this should be documented somewhere, possibly in the doc/FAQ.md file. How about contributing a new entry to help others?

tmo-github commented 6 years ago

I have made a pull request for doc/INSTALL.md. Feel free to edit or relocate the information. My thought was that this is the first file people usually look at, and they will probably find the information more easily here than in the FAQ. As a sidenote, I have on that occasion just discovered that the OpenBSD project has removed support for PIM in the multicast stack starting with version 6.1 (info included in my pull request)

troglobit commented 6 years ago

Thank you so much for taking the time to dive into this and documenting it!