I am very new to networking. I have two clients connected on two different physical interfaces which has upnp running on them. I want to add both of them to the same multicast group, so that they both will discover each other and i will be able to ping each other. Is that possible? How can I achieve this using smcroute?
This is what I have tried:
I created two bridge interfaces(that is the requirement) and connected them to corresponding physical interfaces.
Added following rules to smcroute.conf
mgroup from br1 group 239.255.255.250
mgroup from br2 group 239.255.255.250
mroute from br1 group 239.255.255.250 to br2
mroute from br2 group 239.255.255.250 to br1
ip -s mroute is showing this
# ip -s mroute
(x.x.x.x, 239.255.255.250) Iif: br2 Oifs: br1
242 packets, 46509 bytes
(x.x.x.x, 239.255.255.250) Iif: br1 Oifs: br2
243 packets, 46740 bytes
(x.x.x.x, 239.255.255.250) Iif: unresolved
#
But my clients are not able to discover each other. Am I doing it in a wrong way?
/proc/net/ip_mr_vif shows that there are packets moving in and out of br1 and br2 interfaces.
This is the requirement. I have two physical interfaces which I don't want them to tag to the same bridge due to some organizational restrictions. There will be some clients which will be connected to these interfaces where they have upnp stack running on them. I want them to discover each other.
Solution I am trying here is using arp proxy and smcroute. I am using arp proxy so both the clients will be able to detect the other one. I am using smcroute to tag all the clients connected to these two interface into the multicast group 239.255.255.250 and forward the packets to and fro. Is this the correct approach?
Adding diagram of my setup.
Device 1 Router Device 2
+-----------------+ +----------------------------+ +-----------------+
| | | | | |
| eth1 | | br2 br1 | | wlan0 |
| 169.254.10.10 |-----| 169.254.50.1 10.0.0.1 |----| 169.254.168.11 |
| (self assigned) | | | | (self assigned) |
+-----------------+ +----------------------------+ +-----------------+
Commands used to enable proxy arp:
arp -i br2 -Ds 169.254.168.11 br1 pub
arp -i br1 -Ds 169.254.10.10 br2 pub
ip route add 169.254.168.0/24 dev br1
ip route add 169.254.10.0/24 dev br2
I am able to see packets in ip -s mroute, But devices are not discovered each other:
# ip -s mroute
(169.254.10.10, 239.255.255.250) Iif: br2 Oifs: br1
3 packets, 549 bytes
(169.254.168.11, 239.255.255.250) Iif: br1 Oifs: br2
12 packets, 2196 bytes
(169.254.168.11, 239.255.255.250) Iif: unresolved
(169.254.10.10, 239.255.255.250) Iif: unresolved
#
Tcpdump from the router:
# tcpdump -i br2 -vvv port 1900
tcpdump: listening on br2, link-type EN10MB (Ethernet), capture size 262144 bytes
21:29:20.867399 IP (tos 0x0, ttl 4, id 0, offset 0, flags [DF], proto UDP (17), length 183)
169.254.10.10.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:21.368865 IP (tos 0x0, ttl 4, id 0, offset 0, flags [DF], proto UDP (17), length 183)
169.254.10.10.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:21.869556 IP (tos 0x0, ttl 4, id 0, offset 0, flags [DF], proto UDP (17), length 183)
169.254.10.10.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:24.614276 IP (tos 0x50, ttl 3, id 6384, offset 0, flags [DF], proto UDP (17), length 183)
169.254.168.11.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:25.114268 IP (tos 0x50, ttl 3, id 6393, offset 0, flags [DF], proto UDP (17), length 183)
169.254.168.11.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:25.614997 IP (tos 0x50, ttl 3, id 6680, offset 0, flags [DF], proto UDP (17), length 183)
169.254.168.11.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
^C
6 packets captured
6 packets received by filter
0 packets dropped by kernel
# tcpdump -i br1 -vvv port 1900
tcpdump: listening on br1, link-type EN10MB (Ethernet), capture size 262144 bytes
21:29:40.869434 IP (tos 0x50, ttl 3, id 0, offset 0, flags [DF], proto UDP (17), length 183)
169.254.10.10.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:41.371016 IP (tos 0x50, ttl 3, id 0, offset 0, flags [DF], proto UDP (17), length 183)
169.254.10.10.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:41.871953 IP (tos 0x50, ttl 3, id 0, offset 0, flags [DF], proto UDP (17), length 183)
169.254.10.10.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:44.616742 IP (tos 0x0, ttl 4, id 17080, offset 0, flags [DF], proto UDP (17), length 183)
169.254.168.11.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:45.138486 IP (tos 0x0, ttl 4, id 17334, offset 0, flags [DF], proto UDP (17), length 183)
169.254.168.11.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
21:29:45.622226 IP (tos 0x0, ttl 4, id 17487, offset 0, flags [DF], proto UDP (17), length 183)
169.254.168.11.50759 > 239.255.255.250.1900: [udp sum ok] UDP, length 155
^C
6 packets captured
6 packets received by filter
0 packets dropped by kernel
#
Command Outputs:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 x.x.x.x 0.0.0.0 UG 0 0 0 erouter0
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br1
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 br2
169.254.168.0 0.0.0.0 255.255.255.0 U 0 0 0 br1
239.255.255.250 0.0.0.0 255.255.255.255 UH 0 0 0 br1
#
# ifconfig br2
br2 Link encap:Ethernet HWaddr xxxxxxxx
inet addr:169.254.50.1 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::d02d:5dff:fe68:8e60/64 Scope:Link
UP BROADCAST RUNNING ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:24012 errors:0 dropped:0 overruns:0 frame:0
TX packets:23477 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:4779091 (4.5 MiB) TX bytes:5154708 (4.9 MiB)
#
# ifconfig br1
br1 Link encap:Ethernet HWaddr xxxxxxxx
inet addr:10.0.0.1 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: xxxxxxxxxxxxxxxxxxxxxxxxxx/64 Scope:Global
inet6 addr: fe80::16b7:f8ff:fefe:faf6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:44444 errors:0 dropped:0 overruns:0 frame:0
TX packets:55860 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6780562 (6.4 MiB) TX bytes:11041592 (10.5 MiB)
#
ping
doesn't work, because it doesn't join/leave the multicast groups. To test, you can usessmping
(source-specific multicast) orasmping
(any-source multicast) with group 232.43.211.234. SSDP has local scope (239.255.*.*), though, so I'm not sure if it will be routed in the first place (never tried).ping
? Multicast routing is different from normal routing,ping
will test if normal forwarding works, but nothing else. Your arp problem may be related to the bridge configuration (which you didn't show). So there are 3 separate issues: (1) bridge, (2) forwarding (ping), and (3) multicast. Not sure which you want to solve first ... and that needs more information in any case.