Guest User!

You are not Sophos Staff.

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 -> this cannot be this hard

RevJoe,

you have to use the internal addresses in the packet filters.
DNAT happens before routing and filtering!

SNAT and masquerading happen after filtering,

This means, if you work with any kind of NAT you
have to use the "internal" addresses in  packet
filter rules!!!

Maybe this link is useful
http://packetstorm.widexs.nl/UNIX/firewall/ipchains/netfilter/netfilter-HOWTO.html

regards
ollion

[ 21 February 2002: Message edited by: ollion ]



This thread was automatically locked due to age.
Parents
  • OK modified my rules to read:

    Any  HTTP LinuxServer Allow 
    Internal Any Any Allow 

    And tried this in both orders possible.  Still no work.  Looking at the NAT and Filter rules.  Can anyone post the relevant sections.  I don't even think my rules are being applied.

    Thanks for any leads.  I am so frustrated at this point I am about to jump out my window.


    Joe
  • In your first post, you DNAT your WinNT server.
    In your second post, you added a rule for your linux server. Maybe this is the problem?
  • I am having the same type of problem.  I want an internal IP address to fully act as if it was and outside address.

    I aliases the IP in "Interfaces"

    I added rules to allow to outside IP to send and receive to/from all and did the same thing for the internal IP.

    These are rules 1,2,3,4 so nothing can deny before them.

    I DNAT 0:65535 -> 0:65535 TCP/UDP
    I SNAT 0:65535

    if that machine connects to an outside server it uses the SNAT'd IP address.  But I cannot make connections into the Server.  So it seems that SNAT is working and DNAT is not.

    Any suggestions?  Thanks. Serge.
  • Does anybody have experience with this phenomenon? 
    We are working on the same problem here and can't get DNAT working. The ASTARO-FAQ sais, this might be a problem with the filters. 
    Finally we even set the packet-filter to ANY ANY ANY ALLOW to prevent packets being denied before they reach the internal Server: Still the same...
    Is there anybody who has successfully implemented DNAT and can provide us with some hints?
  • hi guys,

    did you check with 'netstat -an' if any connects reach the internal server(s). so you can find out if DNAT is the problem, or any other routing stuff causes the trouble.

    bye,
    michael
  • Hi Michael!

    Thanks for your quick reply. I just checked this and no active connections between my FW and the Server were displayed. 
    Do you think this can be a routing issue? I can ping the external interface of the FW as well as the aliased IP I want to use for my server. I also can reach the server from my webadmin on the FW. 
    I think, all the FW has to do now is to forward ip-packages for certain ports on the alias-interface to the corresponding ports on the server. This is done by my DNAT rules, isn't it? Do I also have to set up static routes to forward these packages?
  • hi,

    here's what i did, to get dnat running:

    network objects:
    LAN_server 192.168.10.42
    FW_ext_if  192.168.9.1

    DNAT:
    FW_ext_if : SSH : LAN_server : SSH

    Packet Filter rule:
    ANY : SSH : LAN_server : ALLOW

    bye,
    michael
Reply Children
  • hi michael,

    well, these are exactly the same settings we used here (with different IPs of course). But they are not workung with our ASL.

    Our config reads:

    interfaces:
    FW_ext_if 217.x.x.94 255.255.255.224
    Server_alias_if 217.x.x.93 255.255.255.224

    network objects:
    LAN_server 192.x.x.100 255.255.255.255
    Server_ext_alias 217.x.x.93 255.255.255.255

    DNAT:
    Server_ext_alias : SMTP : LAN_server : SMTP

    Packet Filter rule:
    ANY : ANY : ANY : ALLOW (for testing)

    But we still cannot connect to the SMTP-Port on the Lan-Server.

    May it be a problem using subnet 255.255.255.255 for the network and 255.255.255.224 for the alias?

    bye,
    eTrust
  • does your LANserver use the firewall as gateway?
    it should be the interface the lanserver is connected to (e.g. 192.x.x.254)
  • Slap yourself on the shoulder, squeeze! I simply overlooked this point. All the time, I thought the problem was related to the DNAT-function of the firewall. Now, with the gateway-settings changed, everything works fine! Well it's often a little thing causing BIG trouble... :-D

    Thanks a lot!

    eTrust