具有双接口的服务器。
。
接收多播数据。
218.108.132.177是公共网络网关。
125.210.198.1是专用网络网关。
233.49.3.*/24是多播地址。
*/24是多播数据的来源。
当路由表如下所示时,ffmpeg无法从eth1读取udp数据,ffmpeg挂起:
rrca@rcasnap02:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
218.108.132.176 * 255.255.255.252 U 0 0 0 eth0
125.210.198.0 * 255.255.255.240 U 0 0 0 eth1
default 218.108.132.177 0.0.0.0 UG 100 0 0 eth0
default 125.210.198.1 0.0.0.0 UG 100 0 0 eth1
或
rrca@rcasnap02:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
218.108.132.176 * 255.255.255.252 U 0 0 0 eth0
125.210.198.0 * 255.255.255.240 U 0 0 0 eth1
default 218.108.132.177 0.0.0.0 UG 100 0 0 eth0
10.0.11.0 125.210.198.1 0.0.0.0 UG 100 0 0 eth1
或
rrca@rcasnap02:~$ route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
218.108.132.176 * 255.255.255.252 U 0 0 0 eth0
125.210.198.0 * 255.255.255.240 U 0 0 0 eth1
default 218.108.132.177 0.0.0.0 UG 100 0 0 eth0
233.49.3.0 125.210.198.1 255.255.255.0 UG 100 0 0 eth1
我想让ffmpeg工作正常,但现在我认为路由表中的两条默认路由相互干扰,并且我尝试了一下,当公共网关路由被删除,或者私有网关路由处于公共默认网关路由的首位时,ffmpeg运行良好,我认为它可以从eth1读取多播,但是路由表不是这样,ffmpeg不能从eth1读取数据,我认为它在eth0(它不是专用网络接口)上读取数据。
如何使ffmpeg同时工作在两个接口上?
发布于 2012-05-22 10:20:33
您需要为多播通信量配置正确的路由。内核对所有传入的多播通信量进行原点检查:如果它到达的接口与它用来发送此类通信量的接口不同,那么它将被丢弃。
只需在eth1接口上设置组播路由:
# route add -net 224.0.0.0/8 dev eth1
或者,禁用原产地检查:
# echo 0 > /proc/sys/net/ipv4/conf/eth1/rp_filter
发布于 2019-01-21 21:29:20
虽然答案是正确的,因为需要路由,但我不得不路由224.0.0.0/4 (包括最多239.255.255.255),因为我的设备将视频流发送到239.255.42.42。
https://stackoverflow.com/questions/10698533
复制相似问题