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

DMZ on 2nd WAN uplink?

I've tried to diagram this as best I can using ASCII...ugh...Ive tried a bunch of stuff and searched through the 

documentation but I don't do this stuff every day so I'm hoping someone could give me a high-level what components all need 

to be configured to make this work...

    +---------+     +---------+
    |216.2.x.x|     |216.1.x.x|
    +----+----+     +----+----+
           |                     |   
     +---+---+-------+---+---+
     | WAN 1 |******x| WAN 2 +---------+
     +---+---+-------+---+---+             |
           |                    |                      |
     +---+---+       +---+---+          +-------+  
     |  LAN  =- - - -=  DMZ  |           |  DMZ2 |
     +---+---+       +---+---+          +---+---+
           |                    |                      |
     +=======+        /==+==\          /==+==\
     = router   =         = FTP =           = WEB =
     +==+=+==+        \=====/          \=====/
     |    |   |   |
     A    B  C   D

A-D = PC's, etc.


To explain...

I have two WAN connections (two separate public IP's).  I am currently using one for my normal network, and it works great!  Now I want to throw in an FTP server in a DMZ.  But I want it to use a different uplink than my LAN's uplink (point here is so traffic doing FTP won't affect my normal network, and vice-versa)

So...I have an interface created for WAN 2 and an interface called DMZ, but that's as far as I can get it working...or rather, not working haha!

I want to start by allowing SSH from my internal network (LAN) to go to my FTP server, so naturally I created the packet filters to allow it, tried it, scratched my head and 

did some digging and realized I needed to configure more, so I went and added DNAT, took away DNAT, added masquerading, added DNAT, took away, etc. etc. I'm just blindly trying one thing after the next...Who knows what the odds of getting it right are (I think I might buy a lottery ticket instead!).  So I'm wondering if there is a guide that explains how to setup a second interface as a DMZ uplink...Anyone?

By the way I had this PERFECT in a notepad file, copied and pasted it here and lost a bunch of the spacing and stuff...oh well, I tried to tidy it up a bit...Lemme know if it's waaaay unclear or whatever...I could do a visio and slap it up instead I suppose if that helps...?


This thread was automatically locked due to age.
Parents
  • For a visual-tactile learner like me, yeah, it's confusing [:)]

    If you want to do this the "old-fashioned way" (pre-7.4), then look up Policy Routing in the KnowledgeBase.  This sounds lake an opportunity to use Uplink Balancing and Multipathing rules.

    I don't know if/how those new offerings work with QoS, but the biggest problem I saw a client have with FTP was that it would occasionally cause slow response for his users because their HTTP requests couldn't go out fast enough.  We used QoS to guarantee 1MB to outbound port-80 traffic, and the problem went away.
  • Bugger, my ascii art got totally messed up worse than what it was when I pasted it.  Ohw ell, I'll give that stuff a reading (or 3 ha).  Thanks for your response.  Hopefully if/when I get it figured out I'll put the "coles notes" version up to save others the time in the future (I was hoping that'd be out there already but I suppose not yet).

    Thanks!!!
  • OK, thought about his again and think I understand now what you want to do: add a DMZ and a new WAN connection "beside" your existing setup and allow SSH into the DMZ from your LAN.

    For the FTP server in the DMZ, it seems like you just need a DNAT from the new WAN interface to the server in the DMZ.

    For the SSH traffic, it seems like you could SNAT that from 'Internal (Network)' to have it come from 'DMZ (Address)' - where I use "DMZ" as the internal network, not the external second WAN connection.  Either that, or put a second Ethernet adapter into the FTP server and also give it a presence on your 'Internal (Network)'.
Reply
  • OK, thought about his again and think I understand now what you want to do: add a DMZ and a new WAN connection "beside" your existing setup and allow SSH into the DMZ from your LAN.

    For the FTP server in the DMZ, it seems like you just need a DNAT from the new WAN interface to the server in the DMZ.

    For the SSH traffic, it seems like you could SNAT that from 'Internal (Network)' to have it come from 'DMZ (Address)' - where I use "DMZ" as the internal network, not the external second WAN connection.  Either that, or put a second Ethernet adapter into the FTP server and also give it a presence on your 'Internal (Network)'.
Children
  • Yes, sorry, that diagram got messed up and makes it quite unclear what I am trying to accomplish, but you nailed it!

    Regardless, the knowledgebase article on policy routing leaves a bit to be desired (could be updated with some more information in my opinion...It's quite vague for a new-guy like me).

    But after two hours of poking around with it in the wee hours last night...I made progress!

    I am at the point where I can see the traffic hit my firewall, and packet filter inspection allows it through, however it just times out.  This suggests to me I either have something misconfigured on my FTP server (i.e. wrong network settings) or I am missing something on my firewall after the packet filter inspection takes place.

    I am *fairly* sure the FTP server network configuration is fine, but I'll check it tonight when I get home (have ben away all week...).  If that checks out fine, any idea what else it could be (things I could check on ASG)?

    I don't like the idea of throwing in the second NIC on the FTP server and connecting it to my LAN (defeats the purpose of having it in a DMZ doesn't it?).
  • As I said in the second post, I reconsidered the policy routing suggestion once I understood what you wanted.  What does your DNAT rule look like?
  • I wiped out the IP Address if that matters for determining this?

    HH = my trusted network
    SSH = SSH of course
    ftp = IP Address of my FTP Server in DMZ

    I tried with and without the automatic packet filter rule.  I can't recall if it prompted a routing error when I had it enabled or not, but it definitely gets filtered when it is set up manually.

    Thanks for sticking with me on this!
  • I would expect to see something like:

    Traffic Source:  Any 
    Traffic Service:  FTP
    Traffic Destination:  External (Address) 
    NAT mode: DNAT (Destination)
    Destination:  FTP Server
    Destination Service: [leave blank]
    Automatic packet filter rule: checked
  • SUCCESS!  kind of...I was specifying my internal LAN network as the source but it needed to be my WAN address - apparently the traffic is routing out of my WAN gateway and coming back in from the DMZ WAN!  So because the source was actually my WAN address, it was being dropped.  Odd though that when I did specify my internal network it was being passed but no route until I checked off the automatic packet filter rule.  Oh well, I am SO happy now.

    But I want to improve this (not so much for the SSH part but for the FTP function).  i.e. I'll be reducing my throughput from 100Mbit to 6Mbit if I make it go through WAN connections.  I'll poke around with that for a bit and try to get it going first ;o)  Thanks for your help - appreciate it!!!

    So, here's the 'official' solution to get things started (could apply the same theory to use FTP service, web service, etc. I suppose):

    1.  Create your new DMZ WAN interface:
    Network > Interface:
    Type: as applicable (Cable modem DHCP in my case)
    Hardware: Pick an adapter (you will need at least four to pull this off right - one 'normal' WAN and one DMZ WAN, and one internal network, and one internal DMZ network)
    Default GW - unchecked
    Proxy Arp - unchecked
    MTU - 1500

    2.  Create a gateway object for your new DMZ WAN interface:
    Definitions > Networks:
    Type: host
    Address: external *gateway* address of your gw for your wan (in my case it's a 24 bit network so that's an easy one!).  This screwed me up for the longest time because I kept trying to specify the WAN address itself.  Then I thought about it a bit more and came up with this.......It's simple, but that's usually where we make mistakes eh?
    Interface: DMZ_wan

    3.  Create Policy Route:
    Network > Routing > Policy Routes:
    Route Type: Gateway route
    Source: DMZ
    Source Network: DMZ Network
    Service: SSH (or FTP or whatever...)
    Destination Network: Any
    Gateway: wan2_gw

    4.  Make a NAT Masquerading rule:
    Network Security > NAT > Masquerading
    Network: DMZ (Network)
    Interface: DMZ_wan

    5.  Make DNAT rule to allow external access to service:
    Network Security > NAT > DNAT/SNAT
    Traffic Source: DynDNS hostname (or ANY if something like FTP or HTTP)
    Traffic Service: SSH (again, FTP or HTTP, etc.)
    Traffic Destination: DynDNS hostname of DMZ WAN interface (NOT the internal address...duh!)
    NAT mode: DNAT
    Destination: ftp server internal address in DMZ network
    Destination Service: leave blank (totally don't understand this one but it works....)
    Automatic Packet Filter Rule: Checked (I'd prefer to keep all my rules in one spot for easier administration though (i.e. run into a problem and you only have to look at one place for rules, no chance of forgetting second spot...)).

    Ta da!  That should do it.  Now I want to allow my work's address so I can administer from work too - doesn't seem to work when using a network object group that contains any of my "allowed" networks.  Perhaps a second NAT or policy route rule...?  We'll see...
  • Dang, I keep getting a prompt, but the p/w is wrong!  So I connected via console of server and checked that SSH access is on and running and my account is allowed, etc.  It all checks out fine, and I can even do it locally.

    Then...I tried again and noticed the prompt isn't what it should be!  I checked the firewall ssh logs and noticed it's got attempts - it's me!  bah!  Here I thought I had the routing figured out...Suppose not!  Now I realize that the firewall has port 22 running (only open to internal hosts on my lan though of course) so that may be creating a conflict...?  I'll try a different port next when I get some time...Better get painting the window or else!  ;o)
  • Destination Service: leave blank (totally don't understand this one but it works....)

    You aren't changing the service port,  If you were changing the port, but not the destination IP, you would leave 'Destination' blank instead.

    Thanks for posting your solution!

    Cheers - Bob
  • That's what I don't understand...I've specified the nat'd host but it doesn't go there.  I think I need to look at what I've defined as the routes and gateway and such...Perhaps I need to do full NAT to maintain the destination address...?  I'll post the final solution whenever I get to figuring it out!  ;o)
  • I had a bit of difficulty following Post #9, but I think your problem is the route you create in step 3 of that post.  Since the Astaro is a stateful firewall, you don't need to allow traffic in both directions.  If you allow SSH traffic to the DMZ from your Internal network, the Astaro will get the response back to you.  That would make step 2 unnecessary.

    I think that step 4 may be unnecessary, too.  The DNAT that brings requests to the FTP server will, in effect, allow the return traffic.  You only need masquerading if you intend to initiate Internet downloads into the FTP server from the FTP server.

    Step 5 actually has multiple DNATs.  The one that lets your home IP access with SSH won't allow traffic from 'Internal (Network)' into the DMZ.  For that, you will need a SNAT that replaces the source 'Internal (Network)' with 'DMZ (Address)'.  Or, create a policy route.  The disadvantage of the first solution is that the server in the DMZ always sees packets coming from one address.

    Cheers - Bob