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

snat, forwarding?

Hi, I have asl 1.8

external=216.XXX.XXX.XXX
internal=192.168.0.1

internal game server=192.168.0.2

my game server only accepts connections from 192.168.0.0/24 net.

halflife is configured to run on port 27015.

how can i forward request at 216.xxx.xxx.xxx:27015 to 192.168.0.2:27015?

how and where do i put it in webadmin. i get confused with its SNAT configuration page ie. Pre SNAT Source: Service: Destination: Post SNAT Source ... although my browsing works fine.


This thread was automatically locked due to age.
  • As far as I can understand, you should not be using SNAT, but DNAT.

    SNAT, is when you are masquerading the source of something - ie. when the masquerading network is the source.
    In most situations, if not all, I'd say that SNAT is directed OUTBOUND.

    DNAT is when you are masquerading the destination of something, ie. when you are hiding hosts on the inside (masqueraded net inside, live ip on the outside).
    One could say that for most situations, DNAT is directed INBOUND.

    So go ahead try to make a DNAT rule instead.
    Just one thing to make a note of. You need to specify your game server as a service in the firewall, I'll get back to this in a second.

    I had to set up a custom service for a MS Terminal Server on a www server I'm maintaining. It's much similar to what you need to do.
    Sorry for getting lenghty here....   [:)]

    1. You need to have your external and internal NETWORKS defined.
    2. You need a definition that describes the game server as a target. 
    To avoid opening the whole net to the game ports, you need to define your game server with a host route like this (in Definitions-Networks):

    (note all the 255's - there should be four)

    3. You need to define the game server as a SERVICE (done in Definitions-Services):

    NOTE!!! protocol may very well be either tcp or udp, but if I don't know, open both, get it working, and try closing them one at a time and see if it's working.

    In regards to source/destination port, you should be aware that destination port may be fixed, but the source port CAN VARY!!
    If that happens, you should specify s-port/client as 1024:65535 (a range).

    5. Set up a DNAT similar to this one

    External is the NETWORK that is external to my firewall
    MS Terminal Services is a service that is custom defined
    WWW Server is a source route to my internal www server - for set up with netmask 255.255.255.255

    6. Finally, set up a Packet Filter rule that says from: External, Service:Gameserver, to Gameserver, ALLOW.
    Add it, activate it, and you should be online.

    Again, this is the world as I see it. I'd prefer it if someone could confirm the above.
    Try though, it won't hurt anyone   [:)]

    Good luck and best regards,
    Ørjan Sandland

    [ 29 August 2001: Message edited by: Ørjan Sandland ]
  • [QUOTE]Originally posted by Ørjan Sandland:
    [QB]As far as I can understand, you should not be using SNAT, but DNAT.


    Thanks for your time, I did what u said but still no luck. I had this working when i used ipmasqadm.. like this one >

    ipmasqadm portfw -a -P udp -L 216.xxx.xxx.xxx 27015 -R 192.168.0.2 27015

    requests made to 216.x.x.x:27015 will be forwarded to 192.168.0.2:27015. 

    so if a foreign ip 203.167.8.8 sends a request to 216.x.x.x:27015, it will receive a reply but will not be able to join the game server(192.168.0.2) since it is configured to accept only connections from 192.168.0.0/24

    is there any way to make it look like its coming from a 192.168.0.x ip?
  • You may be in the need of SNAT after all.
    I have no experience with game servers at all - but based on what you say, try this:

    1. Add a source route entry for your firewalls internal IP... 
    2. The service gameserver should already be deefined...
    3. add a SNAT like this:
    Pre SNAT Source: External network (the internet)
    Service: Gameserver (ref #3 in the first reply)
    Destination: The source route Gameserver (ref. #2 in the first reply)
    Post SNAT Source: the name of the source route entry of your firewalls inside IP.

    Please understand that I'm just trying to apply general rules and functionality to your case.

    Hope it works now :-)

    Ørjan

    [ 29 August 2001: Message edited by: Ørjan Sandland ]