0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

解決していない問題のメモ。答え募集中!

ip コマンドで multicast group に参加登録できるようになった。これは例えば openvswitch 組み込みの vxlan ポートで multicast を使うときに便利らしい。

つまり、こういう感じにコマンドを実行する。

ip route add 239.0.0.0/24 dev eth0
ip addr add 239.0.0.1 dev eth0 autojoin

無事 ip maddr show dev eth0239.0.0.1 が見えるようになる。

ところがこの状態で、普通の multicast 送信しようとすると、宛先 239.0.0.1 がネットワークの外に出ていかない。local にも loop してこない様子。

import socket
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDP)
s.setsockopt(socket.IPPROTO_IP, socket.IP_MULTICAST_LOOP, 1) # default有効なので不要
# 239.0.0.1 はパケットが送出される気配がない
s.sendto("HOGEHOGE", ("239.0.0.1", 8080))
# 239.0.0.2 は、転送されることが確認できる
s.sendto("HOGEHOGE", ("239.0.0.2", 8080)) 

どこで止められてるんだろうか…?

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?