Networking Forums

Networking Forums > Computer Networking > Linux Networking > DNAT and webserver's access_log

Reply
Thread Tools Display Modes

DNAT and webserver's access_log

 
 
janiz
Guest
Posts: n/a

 
      01-29-2006, 03:49 PM
The problem is simple - I have a router at my home which forwards
incoming requests to different boxes, everything's working ok just the
thing that apache access_log contains only the router's IP as the
source IP.

iptables configuration for web forward:

iptables -t nat -A postrouting_rule -d 10.0.0.0/24 -j SNAT --to-source
$WAN_IP
iptables -t nat -A prerouting_rule -p tcp --dport 80 -d $WAN_IP -j DNAT
--to 10.0.0.253
iptables -A forwarding_rule -p tcp --dport 80 -d 10.0.0.253 -j
ACCEPT

access_log:

<routers_wan_interface_ip> - - [29/Jan/2006:16:58:02 +0200] "GET /
HTTP/1.0" 200 0


Is there any way to forward the right IP for services on non-router's
boxes?

Thanks.

 
Reply With Quote
 
 
 
 
Christoph Scheurer
Guest
Posts: n/a

 
      02-01-2006, 10:38 PM
Am Sonntag, den 29.01.2006, 08:49 -0800 schrieb janiz:
> The problem is simple - I have a router at my home which forwards
> incoming requests to different boxes, everything's working ok just the
> thing that apache access_log contains only the router's IP as the
> source IP.
>
> iptables configuration for web forward:
>
> iptables -t nat -A postrouting_rule -d 10.0.0.0/24 -j SNAT --to-source
> $WAN_IP
> iptables -t nat -A prerouting_rule -p tcp --dport 80 -d $WAN_IP -j DNAT
> --to 10.0.0.253
> iptables -A forwarding_rule -p tcp --dport 80 -d 10.0.0.253 -j
> ACCEPT
>
> access_log:
>
> <routers_wan_interface_ip> - - [29/Jan/2006:16:58:02 +0200] "GET /
> HTTP/1.0" 200 0
>
>
> Is there any way to forward the right IP for services on non-router's
> boxes?
>
> Thanks.


Change your first rule to
iptables -t nat -A postrouting_rule -o $WAN_IF --to-source $WAN_IP

Greets
Chris

 
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
webserver to webserver access via VPN ton de w Windows Networking 3 01-17-2007 08:12 PM
Something between DNAT and REDIRECT Tomasz Grzelak Linux Networking 1 11-12-2006 12:43 AM
DNAT cap Windows Networking 0 01-18-2006 01:04 PM
NAT and Apache2 access_log =?ISO-8859-1?Q?Lutz_Br=F6del?= Linux Networking 6 11-01-2005 12:28 PM
Proxy ARP and DNAT manish Linux Networking 0 08-03-2005 03:56 AM



1 2 3 4 5 6 7 8 9 10 11