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

DNAT Madness

We have an ASG120 between our Cable internet connection and our internal network (Masquaraded).

Going OUT from the internal network works no problem. I've checked a few features (blocking certain sites etc) and they work fine, but I want to enable ssh access to a server from outside our network, and eventually HTTP to a webserver.

Despite following the knowledgebase article 239708 to the letter, I am never forwarded to the server on our internal network. I continually time out.

My DNAT rule is as follows:
Name: SSH to Server
Traffic Source: Any
Traffic Service: SSH
Traffic Destination: External(Address)
NAT Mode: DNAT (Destination)
Destination: Main Server (established in Definitions)
Destination Service: SSH
Auto Packet Filter: unchecked

In Packet Filter I have a rule:
Position: Bottom
Source: External(Address)
Service: SSH
Destination: Main Server
Action: Allow

Both DNAT and Packet Filter rule are enabled, however, it still times out.

However, if i disable the DNAT rule, I can ssh into the Astaro box itself.

Am I missing the obvious here?

Many thanks,
Grant


This thread was automatically locked due to age.
Parents Reply Children
  • Or use a different port for either your SSH DNAT, or Astaro's SSH.


    Barry,

    I changed to port 2222 for my ASG ssh access, and I can ssh into that, but still no luck being forwarded to my server.

    This is also not just an ssh thing. I set up a similar DNAT rule to access my webserver, but I have the same problem. At least in the HTTP case when it times out I get an Astaro page with the error message "Connection to server timed out"

    Is there a recommended simple test I can do just to confirm the DNAT forwarding IS working?

    Thanks. This is my last setup task (ssh & http DNAT) before I can put this into production. 

    Grant
  • As others have mentioned, the source in your packet filter rule needs to be "any", not the external network.
    Also, make sure you have not bound the internal server's definition to an interface, leave the i/f set to any.
  • As others have mentioned, the source in your packet filter rule needs to be "any", not the external network.
    Also, make sure you have not bound the internal server's definition to an interface, leave the i/f set to any.


    I have made the suggested adjustments, but still no luck. My current configuration is as follows:

    Definition

    Name: Main Server
    Type: Host
    Address: 192.168.219.10
    Interface: >

    DNAT Rule

    Traffic Source: any
    Traffic Service: SSH
    Traffic Destination: External(Address)
    NAT Mode: DNAT (Destination)
    Destination: Main Server

    Packet Filter Rule

    Source: Any
    Service: SSH
    Destination: Main Server
    Action: Allow
  • Are there and DNAT rules higher in the list which might be intercepting traffic before this rule?
    It is also possible that a bad NAT rule is causing problems for all of the NATs on the system, this would be obvious by looking at iptables from the shell.
  • Are there and DNAT rules higher in the list which might be intercepting traffic before this rule?


    No higher DNAT rules.

    One NAT Masquarading rule defined:

    Network: Internal(Network)
    Interface: External

    I do appreciate your suggestions.
  • Starting to get to long shots, but...
    Is the Cable modem doing NAT? Do you need to configure port forwarding on it?
    Maybe the ISP is blocking some inbound traffic?

    Are you an Nmap user?
    If you scan the public IP, can you see any open ports? Identify the OS?

    Finally, have support?
  • Starting to get to long shots, but...
    Is the Cable modem doing NAT? Do you need to configure port forwarding on it?
    Maybe the ISP is blocking some inbound traffic?


    Nope...modem isn't doing NAT. I also confirmed that the ISP doesn't block traffic.

    I did discover, however, that If I set my DNAT rule to any -> any -> External(Address) I can ping my internal server.  However, as an extreme test setting my DNAT rule to any -> any -> External(Address), and my PF rule to any -> any -> Internal Server, nothing is passed (except a ping works).

    I do, however have a packet filter rule higher up that is Internal(Network) -> any -> any. This wouldn't be stopping rule processing would it? 

    Grant
  • Check the PacketFilter and IPS logs.

    If nothing shows up as Dropped or Rejected, 
    Run tcpdump on external and internal interfaces, and see if the traffic is getting forwarded.

    Barry
  • Does a dump of iptables match your NAT rules in the GUI?  (iptables -nlV -t nat)

    You may have a bad NAT rule, possibly using a group definition in a field requiring a single entry or a definition inappropriately bound to an interface.
  • I have exactly same issue on my AGP110.  No matter what dnat i setup, it simply will not forward the service through to the appropriate server.

    Did you ever get resolve on this?