troglobit / pimd

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

Using loopback interface as RP-candidate #42

Closed greenpau closed 9 years ago

greenpau commented 9 years ago

I have a loopback interface with IP address 10.254.0.1

[root@ip-192-168-16-66 ~]# ip addr show dev lo
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 10.254.0.1/32 brd 10.254.0.1 scope global lo:1
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
[root@ip-192-168-16-66 ~]# 

In my pimd.conf, I have the following:

phyint eth0 disable
phyint docker0 disable
phyint 10.254.0.1 preference 255
rp_address 10.254.0.1
cand_rp 10.254.0.1
group_prefix 224.0.0.0 masklen 4

Unfortunately, I receive the following error when starting the service:

May 18 19:58:18 ip-192-168-16-66 pimd[3767]: 19:58:18.144 Getting vifs from /etc/pimd.conf
May 18 19:58:18 ip-192-168-16-66 pimd[3767]: 19:58:18.144 Local static RP: 10.254.0.1, group 224.0.0.0/4
May 18 19:58:18 ip-192-168-16-66 pimd[3767]: 19:58:18.144 warning - /etc/pimd.conf:6 - Cand-RP address '10.254.0.1' is not local, defaulting to 0.0.0.0
May 18 19:58:18 ip-192-168-16-66 pimd[3767]: 19:58:18.144 Local Cand-RP address 0.0.0.0, priority 0, interval 60 sec
May 18 19:58:18 ip-192-168-16-66 pimd[3767]: 19:58:18.144 Adding Cand-RP group prefix 224.0.0.0/4
May 18 19:58:18 ip-192-168-16-66 pimd[3767]: 19:58:18.144 IGMP query interval  : 125 sec
May 18 19:58:18 ip-192-168-16-66 pimd[3767]: 19:58:18.144 IGMP querier timeout : 255 sec
May 18 19:58:18 ip-192-168-16-66 pimd[3767]: 19:58:18.144 Cannot forward: no enabled vifs
May 18 19:58:18 ip-192-168-16-66 systemd[1]: pimd.service: main process exited, code=exited, status=255/n/a
May 18 19:58:18 ip-192-168-16-66 systemd[1]: Unit pimd.service entered failed state.

Please assist.

greenpau commented 9 years ago

It has something to do with no enabled vifs. The question is how do I get my virtual interface in there?

troglobit commented 9 years ago

Loopback interfaces are not supported atm. They are filtered out on file:line config.c:168 ... you can experiment with that, but there is no guarantee that it'll work as expected further down.

greenpau commented 9 years ago

@troglobit , thank you for the hint! Surprisingly, it works without any code modifications.

After running:

ip link set lo multicast on
ip link set tun1 multicast on

I could see it started normally:

# pimd -r
Virtual Interface Table ======================================================
Vif  Local Address    Subnet              Thresh  Flags      Neighbors
---  ---------------  ------------------  ------  ---------  -----------------
  2  10.254.0.2       10.254.0.2/32            1  DR NO-NBR
  3  10.254.0.2       register_vif0            1

Multicast Routing Table ======================================================
--------------------------------- (*,*,G) ------------------------------------
Number of Groups: 0
Number of Cache MIRRORs: 0
------------------------------------------------------------------------------

#
troglobit commented 9 years ago

Ah, thanks! This'll go into my HowTo :+1: