Networking Forums

Networking Forums > Computer Networking > Linux Networking > Logging NAT forwards??

Reply
Thread Tools Display Modes

Logging NAT forwards??

 
 
Enrique Ariz?n Benito
Guest
Posts: n/a

 
      07-27-2004, 06:13 PM
Hi, I succesfully setup a NAT. Behind it I have a web server listening
in the 192.168.0.100:8080 port to wich I forward external web
connections with next iptable command:

$IPTABLES -t nat -A PREROUTING --destination $IP_WAN -p tcp --dport 80
--jump DNAT --to 192.168.0.100:8080

My doubt is next:

Is it possible to log external clients connecting to the Web server?

Thanks in advance for any help!
 
Reply With Quote
 
 
 
 
jack
Guest
Posts: n/a

 
      07-27-2004, 09:41 PM
Enrique Ariz?n Benito wrote:
> Hi, I succesfully setup a NAT. Behind it I have a web server listening
> in the 192.168.0.100:8080 port to wich I forward external web
> connections with next iptable command:
>
> $IPTABLES -t nat -A PREROUTING --destination $IP_WAN -p tcp --dport 80
> --jump DNAT --to 192.168.0.100:8080
>
> My doubt is next:
>
> Is it possible to log external clients connecting to the Web server?


Easily so.

You actually have two ways to achieve this: Firstly, You can add a rule
exactly as Yours above, but with the LOG target, just before the DNAT
one. Then, those connections will be logged by iptables on Your router.

Secondly, You can make Your web server logiing connections.


Cheers, Jack.

--
----------------------------------------------------------------------
My personal reading of the string "MicroSoft" expands to "NanoWeak"...
 
Reply With Quote
 
Enrique Ariz?n Benito
Guest
Posts: n/a

 
      07-29-2004, 12:03 PM
jack <(E-Mail Removed)> wrote in message news:<ce6i8k$a73$07$(E-Mail Removed)>...
> Enrique Ariz?n Benito wrote:
> > Hi, I succesfully setup a NAT. Behind it I have a web server listening
> > in the 192.168.0.100:8080 port to wich I forward external web
> > connections with next iptable command:
> >
> > $IPTABLES -t nat -A PREROUTING --destination $IP_WAN -p tcp --dport 80
> > --jump DNAT --to 192.168.0.100:8080
> >
> > My doubt is next:
> >
> > Is it possible to log external clients connecting to the Web server?

>
> Easily so.
>
> You actually have two ways to achieve this: Firstly, You can add a rule
> exactly as Yours above, but with the LOG target, just before the DNAT
> one. Then, those connections will be logged by iptables on Your router.
>
> Secondly, You can make Your web server logiing connections.
>


>
> Cheers, Jack.


Thanks, I didn't know about the LOG target. I probed and it worked
flawessly.

(P.S: The problem with the web server logging was that now external
clients appears as 192.168.0.1 connections, but internal clients also
access inderectly the web server through squid that is located in the
same NAT server since many times people forget to check the "disable
proxy for internal address" in its web browser).
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
DMZ for logging Harry Putnam Linux Networking 10 01-31-2012 06:26 PM
DNS forwards to a wrong IP foxy1234 Linux Networking 7 08-18-2007 04:09 PM
IAS logging to SQL Please help Mike Adams Windows Networking 0 09-28-2006 06:23 PM
URL logging Fred Home Networking 4 07-08-2005 05:19 PM
one subnet forwards and one does not ?? dan Linux Networking 0 08-21-2004 01:48 AM



1 2 3 4 5 6 7 8 9 10 11