• Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login
Netgate Discussion Forum
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Search
  • Register
  • Login

NAT problem with RTCP server

Scheduled Pinned Locked Moved NAT
6 Posts 3 Posters 1.4k Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • X
    xeonz
    last edited by Jun 9, 2018, 6:35 AM

    Hello.

    I am sure I've catch a bug in pfsense software. I have RTCP server on tcp port 554 in my LAN with LAN IP 10.0.10.20 and gateway 10.0.10.1 which is pfsense virtual machine of version 2.4.3. I have simple pfsense config with only several nat and firewall rules which allows access to my RTCP server from WAN using port forwarding:
    0_1528525240228_48958071-dea3-43c1-9087-32bb812a347f-изображение.png
    0_1528525263531_4b3d3ec3-afcd-4d64-a312-254c96cc1d4c-изображение.png
    0_1528525291376_5008ff1d-3d4c-4302-8e7e-3f48b04385eb-изображение.png
    0_1528525464552_3717d0de-2c68-488d-862c-15efe0b9755a-изображение.png
    As you can see there is tcp port 554 is forwarded from wan and there is standard outbound nat with static port option active.
    Also you can see disabled "allow all from wan" firewall rule.

    So the issue.
    When I activate "allow all from wan" firewall rule and if I have static port option active in outbound nat rule the pfsense does NOT translate source IP address of outgoing RTP UDP streams and keep source IP 10.0.10.20 while RTP traffic flow to WAN RTCP client somewhere in the internet. I can see this if I collect traffic dump on WAN interface of pfsense.
    If I activate "allow all from wan" rule in firewall and disable static port option in outbound nat rule then pfsense DOES translate source IP in RTP streams but does not keep port numbers (as it must to do without static port) and so RTP streams cannot reach RTCP client because of RTP packets have different ports from what was negotiated in signaling protocol.

    So I have to use static port in my case for RTP streams can reach RTCP client and if I activate "allow all from wan" rule in furewall settings I have the issue with no translating source IPs of RTP packets.

    I am sure this is a bug. How can I report it if it's really a bug? if its not a bug - why I have not translated source IPs in RTP streams?

    1 Reply Last reply Reply Quote 0
    • X
      xeonz
      last edited by Jun 9, 2018, 6:46 AM

      I am ready to send in private pcap traffic dumps with signalling and rtp packets. I don't want to upload it to public thread as they contain public IPs.

      1 Reply Last reply Reply Quote 0
      • S
        stephenw10 Netgate Administrator
        last edited by Jun 11, 2018, 3:05 PM

        It looks like WAN firewall rule you have added for your port 554 port forward is incorrect. It should have destination 10.0.10.20 to match the forward. That's why you need to enable the allow all rule.

        The reason you see traffic leaving the WAN un-NAT'd is usually because a state for that already exists so a new state cannot be created. If you already have traffic using the same source and destination IPs and ports that's what you'll see.
        That's why source port randomisation is often required for older protocols with fixed source ports.

        Make sure you don't have an open state already that matches it.

        Steve

        1 Reply Last reply Reply Quote 0
        • X
          xeonz
          last edited by Jun 12, 2018, 3:37 PM

          "It looks like WAN firewall rule you have added for your port 554 port forward is incorrect. It should have destination 10.0.10.20 to match the forward. That’s why you need to enable the allow all rule."
          No. The NAT redirection rule has destination 10.0.10.20 as "translation destination". It simply not visible in nat rules list.
          And no - the server works fine if I DISABLE "allow all from internet" rule in firewall. If I enable this rule - I cannot see video stream in my client application.

          "Make sure you don’t have an open state already that matches it."
          I only test with one client application. And its stable situation - when I disable "allow all from inet" - I can see video stream and in traffic dump I always see that all RTP packets have translated source IPs. If I enable "allow all from inet" rule I cannot see video stream and I see untranslated source IPs in RTP streams. I repeated my tests many times and every time I have this results.

          1 Reply Last reply Reply Quote 0
          • D
            Derelict LAYER 8 Netgate
            last edited by Derelict Jun 12, 2018, 5:31 PM Jun 12, 2018, 5:30 PM

            No.

            Firewall rules are processed post-NAT. So the rule passing traffic to WAN Address port 554 will NOT match traffic to the NAT port forward.

            The destination on that firewall rule needs to be the real, inside address of the server, 10.0.10.20, not WAN Address.

            Chattanooga, Tennessee, USA
            A comprehensive network diagram is worth 10,000 words and 15 conference calls.
            DO NOT set a source address/port in a port forward or firewall rule unless you KNOW you need it!
            Do Not Chat For Help! NO_WAN_EGRESS(TM)

            1 Reply Last reply Reply Quote 0
            • X
              xeonz
              last edited by Jun 12, 2018, 5:44 PM

              Yes, you are right. However the rule which allows tcp port 554 even not needed because of I have an option "pass" in the nat redirection rule for port 554. And I have a question regarding the rule "allow all from internet", not the rule "allow tcp port 554".

              1 Reply Last reply Reply Quote 0
              6 out of 6
              • First post
                6/6
                Last post
              Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.
                This community forum collects and processes your personal information.
                consent.not_received