natd redirected ports from LAN

From: asko (asko_nospam_at_ultrasoft.ee)
Date: 11/29/05

  • Next message: Brian Candler: "Re: natd redirected ports from LAN"
    Date: Tue, 29 Nov 2005 12:46:10 +0200
    To: freebsd-net@freebsd.org
    
    

    Hi,

    As you know, natd redirected ports in router from WAN to LAN work only
    from outside.
    http://lists.freebsd.org/pipermail/freebsd-questions/2003-August/015552.html

    For example,

    www.example.com has public IP - a.b.c.d
    webserver is in LAN, 192.168.1.10
    router is 192.168.1.1

    #rc.conf
    natd_enable="YES"
    natd_flags="-f /etc/natd.conf"
    natd_interface="fxp0"
    gateway_enable="YES"

    #natd.conf
    use_sockets yes
    same_ports yes
    unregistered_only yes
    redirect_port tcp 192.168.1.10:80 80

    The query http://a.b.c.d:80 works from outside, but does not work from
    inside (LAN).

    One solution is redirecting local port to 192.168.1.10:80
    # inetd.conf
    www stream tcp nowait nobody /usr/local/bin/nc nc -w 3
    192.168.1.10 80

    and adding ipfw rule:
    00040 fwd 192.168.1.1,80 tcp from 192.168.1.0/24 to a.b.c.d dst-port 80

    It works, but it is not very elegant, because it involves user level
    programs inetd and netcat. I'm searching for a better, faster solution..
    Does it exist?

    --
    asko
    _______________________________________________
    freebsd-net@freebsd.org mailing list
    http://lists.freebsd.org/mailman/listinfo/freebsd-net
    To unsubscribe, send any mail to "freebsd-net-unsubscribe@freebsd.org"
    

  • Next message: Brian Candler: "Re: natd redirected ports from LAN"

    Relevant Pages

    • Re: Network Hardware
      ... LAN With Two Routers" and now wonder whether or not to send this message as ... I was also hoping to use the DLink Router ... have to go through the router to get to the internet on the other subnet. ...
      (microsoft.public.windowsxp.network_web)
    • Re: DirectPlay troubleshooting
      ... Number 6 does indeed recommend *disabling* that feature of your router ... as it is a troubleshooting step which has solved LAN gaming issues in some ... MS Games Help and Support Center: http://support.microsoft.com/?pr=gms ... ||| out directplay by establishing a 'chat' session, ...
      (microsoft.public.games)
    • SBS 2003 Premium, Multi-Homed, Problem with OMA
      ... LAN port in use on that router is the SBS 2003 Premium box. ... NIC as primary DNS with the wireless router as secondary DNS. ...
      (microsoft.public.windows.server.sbs)
    • Re: WEP and MAC Filter
      ... Machines with wifi adaptors connect to the lan ... via the router radio connection. ... and wireless PCs would be on the same LAN subnet, ... DHCP server in the LAN, then you should disable the router's DHCP server ...
      (alt.internet.wireless)
    • Re: DMZ / Firewall question
      ... Have a Netgear DSL modem/router with a DMZ port. ... LAN side of the router has a number of XP PCs. ... "DMZ" is really just a virtual server port, ...
      (microsoft.public.windowsxp.network_web)