This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Port Forwarding

Hi,

I come from an untangle utm background.
Does anyone know how can we define port forwards in a way as much powerful as untangle allow ?

For example, for a port forward, we can define any number of type conditions (destination port, source address, protocol...) and give the corresponding value for each entry, then we fullfill the destination adress and port.

I didn't see how to achieve this into Astaro. 
Am i misssing somehting ?


This thread was automatically locked due to age.
  • Finally i didn't manage to find an elegant or even a correct way to achieve this for example : 
    Conditions :
    Destination port : 8080
    Source address : 212.27.38.253
    Protocol : TCP - UDP - ICMP

    Forward traffic to the following location :
    New destination : 176.16.2.51
    New port : 8080

    How would you do this ?
  • Hi Kynao, 

    the Astaro DNAT/SNAT capabilites allows to do all the stuff that untangle can also do. 

    Here are the examples you requested above. 
    Rule 1)
    You need to set
    Type: DNAT
    Source: Any
    Service: FTP
    Destination: External Interface IP

    Forward to:
    Host: Host-192.168.254.20

    That will forward all FTP traffic that reaches the external interface to your internal server 192.168.254.30.

    Rule 2)
    You need to set
    Type: DNAT
    Source: Any
    Service: Custom Servicedefinition (TCP 5500-5700)
    Destination: External Interface IP

    Forward to:
    Host: Host-192.168.254.20

    Last Post)
    I assume that you want to forward all TCP/UDP port 8080 traffic arriving from external to 212.27.38.253 and forward it to 176.16.2.51 on port 8080.
    If yes, than you need to set:

    You need to set
    Type: DNAT
    Source: Any
    Service: Custom Service (TCP/UDP 8080)
    Destination: External Interface IP

    Forward to: host 176.16.2.51

    The first part of the rule matches the traffic you want to redirect, than the second part modifies the traffic to be forward to your desired destination.

    i hope that helps, 
    regards
    Gert


    Host: Host-192.168.254.30
  • Hello Gert HAnsen and thanks a lot for taking time to expose your explanations.
    Based on your informations, here how i adapt to make it work :

    Type: DNAT
    Traffic Source: a host with 212.27.38.253
    Traffic Service: Custom Service (TCP/UDP 8080)
    Traffic Destination: External (Wan) (Network)

    Destination: host with  176.16.2.51
    Destination Service :  Custom Service (TCP/UDP 8080)

    The question here is how to manage icmp not taken into account in this rule, apparently in Astaro, we have to define icmp precisely, contrary to untangle where we can select icmp whatever operation nature. whatever, for what i have to do, it apparently works, my question is just for the knowledge.
  • Hi all!

    Another Astaro newb migrating from Untangle! I've been reading many KB's and documents and have a problem with port-forwarding which I hope you guys will help me resolve based on the information I am going to provide below:

    I have an Asterisk PBX I've set up on my D-Link DNS323; it worked just fine from inside and outside my LAN when I was using my Netgear WNR300 router using Tomato.

    The server uses UDP port 7363 for SIP Signaling (5060 was not secure... as was proven by some Lithuanian buttmunch) and UDP port range 19980-20000 for RTP traffic (two phones on the PBX... don't need anything else really). The server registers to SipGate.com which is done without a problem.

    Here's what I've done so far:

    1. I've created a service called DNS SIP which defines UDP port 7363 as the destination port for SIP signaling:


    2. I've created a service called DNS RTP which defines UDP port range 19980:20000 as destination ports for RTP:


    3. I've created a DNAT rule to allow external IP's to connect to the PBX using port 7363 for SIP signaling; this is a 1-1 translation. the "Destination" is configured to be the DNS323 device which is statically mapped to a.b.c.40 on my LAN:


    4. I've created a DNAT rule to allow external IP's to connect to the PBX using ports 19980-20000 for RTP; this is also a 1-1 (well 20-20 lol) translation. 


    Both these DNAT rules are "enabled" meaning the green light is lit. 

    Here's what's happening:

    From outside my LAN, the SIP phone app on my iPhone successfully registers with my Asterisk server. However, when I place a call, I get no RTP - it will ring the destination which I can pick up but there's no voice transfer. Soon after the call will just drop. 

    From inside my LAN it's basically the same story - my "phone" will connect to the PBX, the PBX will attempt to connect to the destination which rings and I can pick up, however about 5 seconds in, the call drops and while I have the call progressing there will be no RTP. 

    My only conclusion is that my port forwarding is flawed. 

    I did a live log and this is what I see when I try to do a call using the SIP phone app on my iPhone while it is outside my LAN (using ATT's 3G network):

    23:35:44  Default DROP  UDP 
    a.b.c.40  :  19994  →  e.f.g.169  :  64598


    23:35:44  Default DROP  UDP 
    a.b.c.40  :  19994  →  e.f.g.169  :  64598


    23:35:44  Default DROP  UDP 
    a.b.c.40  :  19994  →  e.f.g.169  :  64598


    23:35:48  Default DROP  UDP 
    a.b.c.40  :  19996  →  204.155.29.56  :  45304


    23:35:48  Default DROP  UDP 
    a.b.c.40  :  19996  →  204.155.29.56  :  45304


    a.b.c.40 is the internal (LAN) IP of my Asterisk PBX; e.f.g.169 is the IP address of my iPhone (as provided by ATT) and 204.155.29.56 is a SipGate IP (which acts as the relay).... as you can see the firewall still drops packets.

    So Astaro gurus... what am I doing wrong here?? 

    Thanks!!!
  • Hi, do you have any PacketFilter rules to allow the PBX to make outbound connections?

    Also, do you have Masquerading setup for your LAN(s) to the EXT interface?

    Barry
  • Hi, do you have any PacketFilter rules to allow the PBX to make outbound connections?

    Also, do you have Masquerading setup for your LAN(s) to the EXT interface?

    Barry


    Hi Barry,

    Yes I do have masquerading setup:



    I also believe I have the outbound packetfilter rule setup properly... I tried both of these setup:



    It still fails... : (



    Where service DNS RTP is this:
  • Woohoo! Success!

    SUCCESS!

    So as a member on another forum suggested - I modified the sip.conf file to include my external IP dns (ha, it accepted) and the localnet ip. I also allowed reverse RTP on the packet filter rule andddd.... success!

    This should be "safe" right?

  • Hi, sip.conf might get overwritten by up2date.

    Your PacketFilter Rule is wrong... should be 
    Internal -> ANY
    not
    Internal -> WAN

    WAN is the external interface only, or WAN (Network) would only be your ISP's subnet.

    Barry
  • Hi, sip.conf might get overwritten by up2date.

    Your PacketFilter Rule is wrong... should be 
    Internal -> ANY
    not
    Internal -> WAN

    WAN is the external interface only, or WAN (Network) would only be your ISP's subnet.

    Barry


    Hi Barry,

    Which specific screenshot are you referring to? I replicated the packetfilter rule for RTP using template for all the other rules... changing only the service type.

    Thanks!


    edit: btw - the sip.conf was edited on my pbx, not on the astaro box.
  • Sorry, nevermind... I thought the NAT/Masq was a PacketFilter.

    Barry