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 question -newbie

Can someone help me with example how to configure Astaro  to allow connetion to FTP server located in Astaro's DMZ ? (masquerading/nat, dnat/snat, policy rules)

I have Astaro 3.2 with 3 interfaces. I installed FTP server in DMZ. When trying to connect to FTP server from outside I am getting "connected to FTP server" message and  then "connection to ftp server closed" right away.

I would like to allow outside user from internet to connect to this FTP server and internal user to connect to it as well using private or public IP address  FTP server

all help appreciated

regards

marcin    


This thread was automatically locked due to age.
Parents
  • Does the FTP server box have a public IP ?

    I assume it has a private IP in a range you have set for the DMZ ?

    You need to setup NAT to forward port 21 requests to the FTP server.  Ports 21 and 20 should be allowed through fw.

    Suggest you search forums for FTP and NAT or similar and you should find some help on doing this.
    Please note ftp client probably needs to be in passive mode. 
  • IP address of the FTP server is 172.18.100.14 (subnet on the DMZ network but of course I want to NAT it to 204.xxx.xxx.51 for internet users to be able to connect to it  
Reply Children
  • First setup a DNAT/SNAT defintion to change the address of the ftp server from private space to public space.  You can also create a definition for the ftp server if you prefer to work with names instead of ip addresses.  Also I would define a servce group for FTP, this makes defining rules easier.

    Next define a rule that allows tcp ports 20 and 21 through the firewall to the ftp server.  Using the addresses you provided the rule should look something like 

    source any -> protocol ftp -> destination 204.xxx.xxx.51 allow.

    This rule will allow ftp through the firewall then the DNAT rule will translate the address and pass it on to the ftp server.

    This should take care of users accessing ftp from the Internet.  If you also want to allow users to access ftp from your internal lan just create a rule like

    source InternalLAN -> protocol ftp -> destination 172.18.100.14 -> allow

    Craig White   
  • Still in the woods.
    In live packet logging I can see 3  SYN  coming to Astaro but no SYN ACK or ACK.

    Here is my setup:

    1. I created network entry called "ftp_dmz" with IP address     172.18.100.14
    2. I created additional interface on outside physical interface called "Outside_ftp" with address 204.xxx.xxx.51
    (I have public C class so I can use dedicated public IP to my FTP instead of using IP address of physical outside interface)


    Now here is the point where probably I make some mistakes!!!!

    3. I created DNAT/SNAT called "FTP_outside_dmz"  and configured as following:

    Rule type: DNAT/SNAT
    In "Packet to match"  section I chose:

    Source address: "ftp_dmz" (172.18.100.14)
    Destination address: "any"
    Service: FTP


    In section "Change source to": 
    I chose "Outside_ftp_interface" (204.xxx.xxx.51)

    In section "Change destination to":
    I chose "no change"

    In packet filter rules I created rule"
    source any>protocol ftp> destination Outside_ftp_interface (204.xxx.xxx.51) allow

    I have strong feeling that DNAT/SNAt is not ok.
    Do I need to create DNAT/SNAT for packet leaving FTP server from DMZ to translate it to 204.xxx.xxx.51 instead of ip address of physical outside interface wqhich is 204.xxx.xxx.1?

    When creating DNAT/SNAT what I should put under "source address" and "destination address"

     
           
  • DNAT/SNAT should be:

    Source addr: Any
    Destination addr:  public IP assigned to FTP server on Red iface.
    Service: FTP

    Change source to: no change
    Change destinatio to: private IP of FTP server box.

    In other words, "Any FTP traffic arriving at my public IP for FTP, grab it and send it to the internal IP of the FTP server"

    Hope that helps.
    Your setup looks OK otherwise.  Check packet filter live log after fixing SNAT/DNAT.
  • [ QUOTE ]
    !

    3. I created DNAT/SNAT called "FTP_outside_dmz"  and configured as following:

    Rule type: DNAT/SNAT
    In "Packet to match"  section I chose:

    Source address: "ftp_dmz" (172.18.100.14)
    Destination address: "any"
    Service: FTP


    In section "Change source to": 
    I chose "Outside_ftp_interface" (204.xxx.xxx.51)

    In section "Change destination to":
    I chose "no change"

    In packet filter rules I created rule"
    source any>protocol ftp> destination Outside_ftp_interface (204.xxx.xxx.51) allow

    I have strong feeling that DNAT/SNAt is not ok.
    Do I need to create DNAT/SNAT for packet leaving FTP server from DMZ to translate it to 204.xxx.xxx.51 instead of ip address of physical outside interface wqhich is 204.xxx.xxx.1?

    When creating DNAT/SNAT what I should put under "source address" and "destination address"

     
            

    [/ QUOTE ]

    One thing. your rule is backwards. should be.
    source: any
    Destination: 172.18.100.14

    for tighter security make your nat:
    source: external nic (public ip)
    match: any
    service: ftp
    destination : the ftp server
    make destination and source both no change

    That will get your nat working. 
    you will need a rule that will allow ftp to the ftp box. like
    any > ftp >ftp_box >allow   
  • I really appreciate your help but I still cannot make it work.

    I tried almost all options and combination for NAT and no success.

    However, there is one scenario when I can do ftp. Here is how:

    I am using same Astaro as a VPN box.
    When I connect t from home to Astaro as VPN PPTP client and obtain IP address from internal Astaro's network (192.168.1.xxx) then I can ftp to server to it's dmz IP (172.18.100.14) or to it's public IP address (204.xxx.xxx.51)
    The moment I disconnect my VPN PPTP connection from Astaro I can't anymore ftp to the server 

    When watching "Filter Live Log" I can see SYN request from public ip of the client which is trying to connect to FTP server but no SYN ACK reply from FTP server   


    Would you mind if I let you login to this box so you could verify my setup?    [:S]   
  • It finally works....!!!!!!
    and I don't know why?....I tried same setup again and again. Finally it started to work like a charm.
    Thank all you guys for help.
    Appreciated.
        
  • Yay ! If you do get really stuck I don't mind logging into the box to take a look at your setup.  Promise not to destroy everything [:)]