一个网卡有多个ip时srt不能推流问题(lesson)

之前做主备时,发现网卡有2个ip时(其中一个是虚拟ip,推流到虚拟ip),srt不能推流。

后来调查发现是网络回包时源ip选择错误引起。如下图所示:

192.168.11.161是第一ip,192.168.11.163是虚拟ip(推流到192.168.11.163)

#ip route

169.254.0.0/16 dev enp0s3 scope link metric 1002 
192.168.0.0/20 dev enp0s3 proto kernel scope link src **192.168.11.161**
#tcpdump -i enp0s3 port 14000 -n

00:59:32.933525 IP 192.168.11.222.54108 > **192.168.11.163**.scotty-ft: UDP, length 204
00:59:32.944368 IP **192.168.11.161**.scotty-ft > 192.168.11.222.54108: UDP, length 44

解决方法是修改路由表src属性,使用如下命令修改:

ip route change dev enp0s3 192.168.0.0/20 src **192.168.11.163**

修改后的结果如下所示:

#ip route

169.254.0.0/16 dev enp0s3 scope link metric 1002 
192.168.0.0/20 dev enp0s3 proto kernel scope link src **192.168.11.163**

#tcpdump -i enp0s3 port 14000 -n

00:59:32.933525 IP 192.168.11.222.54108 > 192.168.11.163.scotty-ft: UDP, length 204
00:59:32.944368 IP 192.168.11.163.scotty-ft > 192.168.11.222.54108: UDP, length 44

至此,能正常进行srt推流。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

^_^ 纵歌

工作中的经验分享

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值