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

interface with multiple IPs not working #196

Closed zadm closed 2 years ago

zadm commented 2 years ago

Hello,

I'am configuring pimd in a linux box acting as a router, I have a vlan interface with 2 ips

ip add show bond1.2016
300295: bond1.2016@bond1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default 
    link/ether a0:36:9f:d4:65:0a brd ff:ff:ff:ff:ff:ff
    inet 192.168.3.169/29 brd 192.168.3.175 scope global bond1.2016
       valid_lft forever preferred_lft forever
    inet 10.200.75.161/27 brd 10.200.75.191 scope global bond1.2016
       valid_lft forever preferred_lft forever
    inet6 fe80::a236:9fff:fed4:650a/64 scope link 
       valid_lft forever preferred_lft forever

The receiver machine behind the interface bond1.2016 is configured with an ip in the network 10.200.75.161/27

bellow pimd config file

cat /etc/pimd.conf 

phyint tun10 enable igmpv2
phyint bond1.2016 enable igmpv2
#rp-candidate tun10 time 30 priority 1
#bsr-candidate tun10 priority 5

rp_address  X.X.X.X 224.0.28.89 masklen 32

cand_rp time 30 priority 20         # Smaller value means "higher" priority
cand_bootstrap_router priority 5    # Bigger value means  "higher" priority
spt-threshold                   rate 50000 interval 20  # 50kbps (approx.)

When I start pimd with this config, it create the bellow entry in the routing table

irtual Interface Table ======================================================
Vif  Local Address    Subnet              Thresh  Flags      Neighbors
---  ---------------  ------------------  ------  ---------  -----------------
  0  192.168.3.169/29    192.168.3.168/29         1  DR NO-NBR     ==> bond1.2016
  1  10.247.4.178     10.247.4.176/30          1  DR PIM     10.247.4.177   ==> tun10
  2  192.168.3.169     register_vif0            1 

 Vif  SSM Group        Sources             

My question is how can I configure pimd to create an entry in the 10.200.75.161/27 network? Or how can make my setup working with 2 IPs ?

FY, I tried to add the ip instead of the interface in the config file but this is not working

Regards

ruckc commented 2 years ago

If your trying to use VLANs then your network configuration is wrong. Normally, I only see multiple IP addresses on a NIC if they belong to the same subnet. When PIMD sends network traffic, it sends it out the device (bond1.2016) and the device chooses the source IP address.

I would recommend having those two subnets on separate VLANs so their broadcast traffic doesn't overlap.

zadm commented 2 years ago

Hello ruckc,

thank you for your quick response.

I think my network setup is not wrong because I can see the igmp report traffic in the interface bond1.2016 from the receiver machine

my concern is that when the receiver machine try to subscribe to the multicast groups, I can't see any entry in the Multicast Routing Table

sudo  tcpdump -nni bond1.2016  multicast
13:40:52.455788 IP 0.0.0.0 > 224.0.28.89: igmp v2 report 224.0.28.89
13:40:52.457113 IP 0.0.0.0 > 224.0.28.216: igmp v2 report 224.0.28.216
13:40:52.457457 IP 0.0.0.0 > 224.0.28.89: igmp v2 report 224.0.28.89
13:40:52.475328 IP 0.0.0.0 > 224.0.28.47: igmp v2 report 224.0.28.47
13:40:52.500397 IP 0.0.0.0 > 224.0.28.174: igmp v2 report 224.0.28.174
13:40:52.524270 IP 0.0.0.0 > 224.0.28.5: igmp v2 report 224.0.28.5
13:40:52.526819 IP 0.0.0.0 > 224.0.28.216: igmp v2 report 224.0.28.216
13:40:52.527020 IP 0.0.0.0 > 224.0.28.216: igmp v2 report 224.0.28.216
13:40:52.550986 IP 0.0.0.0 > 224.0.28.47: igmp v2 report 224.0.28.47
13:40:52.558145 IP 0.0.0.0 > 224.0.28.132: igmp v2 report 224.0.28.132
13:40:52.572077 IP 0.0.0.0 > 224.0.28.174: igmp v2 report 224.0.28.174
13:40:52.613778 IP 0.0.0.0 > 224.0.28.5: igmp v2 report 224.0.28.5
13:40:52.626448 IP 0.0.0.0 > 224.0.28.216: igmp v2 report 224.0.28.216
13:40:52.634399 IP 0.0.0.0 > 224.0.28.132: igmp v2 report 224.0.28.132
13:40:52.641213 IP 0.0.0.0 > 224.0.28.47: igmp v2 report 224.0.28.47
13:40:52.720979 IP 0.0.0.0 > 224.0.28.174: igmp v2 report 224.0.28.174
13:40:52.721593 IP 0.0.0.0 > 224.0.28.5: igmp v2 report 224.0.28.5
13:40:52.738742 IP 0.0.0.0 > 224.0.28.132: igmp v2 report 224.0.28.132
13:40:52.838502 IP 0.0.0.0 > 224.0.28.5: igmp v2 report 224.0.28.5
13:40:52.862502 IP 0.0.0.0 > 224.0.28.89: igmp v2 report 224.0.28.89
13:40:52.886524 IP 0.0.0.0 > 224.0.28.47: igmp v2 report 224.0.28.47
13:40:52.906789 IP 0.0.0.0 > 224.0.28.89: igmp v2 report 224.0.28.89
13:40:53.098556 IP 0.0.0.0 > 224.0.28.174: igmp v2 report 224.0.28.174
13:40:53.166288 IP 0.0.0.0 > 224.0.28.132: igmp v2 report 224.0.28.132
sudo pimd -r 
Virtual Interface Table ======================================================
Vif  Local Address    Subnet              Thresh  Flags      Neighbors
---  ---------------  ------------------  ------  ---------  -----------------
  0  192.168.3.169    192.168.3.168/29          1  DR NO-NBR
  1  10.247.4.178     10.247.4.176/30          1  DR PIM     10.247.4.177   
  2  192.168.3.169     register_vif0            1 

 Vif  SSM Group        Sources             

Multicast Routing Table ======================================================
--------------------------------- (*,*,G) ------------------------------------
Number of Groups: 0
Number of Cache MIRRORs: 0
------------------------------------------------------------------------------
troglobit commented 2 years ago

If I understood your setup, I think you may be able to solve your problem by using the altnet 10.200.75.161/27 argument to phyint.

In pimd versions < 3.x, the first interface address found is the only address pimd considers. As of pimd 3.0 (still unreleased), the first address found enumerates the VIF and any other addresses found for the same interface adds altnets automatically.