V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
guanyin9cn
V2EX  ›  Linux

关于 RTSP 协议, iptables 策略。有个奇怪的现象。

  •  
  •   guanyin9cn · Aug 30, 2021 · 2129 views
    This topic created in 1715 days ago, the information mentioned may be changed or developed.
    找的 iptv 源 ,rtsp 协议,端口 554 。

    光猫 防火墙开高时,iptv 不能正常播放,比较了下 高和中的 iptables 策略区别。多了个

    -A FWD_FIREWALL -i br+ ! -o br+ -j DROP



    -A FWD_IPFLT -i br+ -p tcp -m tcp --dport 443 -j ACCEPT
    -A FWD_IPFLT -i br+ -p tcp -m tcp --dport 80 -j ACCEPT
    -A FWD_IPFLT -i br+ -p tcp -m tcp --dport 21 -j ACCEPT
    -A FWD_IPFLT -i br+ -p udp -m udp --dport 53 -j ACCEPT
    -A FWD_IPFLT -i br+ -p tcp -m tcp --dport 53 -j ACCEPT


    直接在 forward 里 加 iptables 策略,用的I插到最前面。
    iptables -I FORWARD -i br+ -p tcp --dport 554 -j ACCEPT
    不通,
    抓包看看,服务器有响应包。只与 554 端口通信。
    很奇怪

    再改  iptables -I FORWARD -i br+ -p tcp -j ACCEPT,放开所有来自 br 的 tcp 包。
    可以了。

    随便找一个 HTTP 协议的 服务器,端口 888,
    用 iptables -I FORWARD -i br+ -p tcp --dport 888 -j ACCEPT
    可以正常通信。

    请问 RTSP 有什么特殊之处?
    Supplement 1  ·  Aug 30, 2021
    回包


    Transport: RTP/AVP; unicast; client_port=

    请问,tcpdump 如何抓单播 包?
    5 replies    2021-09-02 23:29:58 +08:00
    wqtacc
        1
    wqtacc  
       Aug 30, 2021
    rtsp 播放视频使用的 udp?
    guanyin9cn
        2
    guanyin9cn  
    OP
       Aug 30, 2021
    @wqtacc tcp
    LGA1150
        3
    LGA1150  
       Aug 31, 2021
    https://github.com/maru-sama/rtsp-linux
    RTSP 是需要特殊处理,你的光猫有没有这个模块?有没有应用层网关( ALG )选项?
    guanyin9cn
        4
    guanyin9cn  
    OP
       Aug 31, 2021
    @LGA1150 hua wei 光猫,开启的。
    wqtacc
        5
    wqtacc  
       Sep 2, 2021
    @guanyin9cn 我是说音视频流用的时 udp,防火墙开的 tcp?
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3151 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 39ms · UTC 14:44 · PVG 22:44 · LAX 07:44 · JFK 10:44
    ♥ Do have faith in what you're doing.