Networking Forums

Networking Forums > Computer Networking > Linux Networking > IPTables and IIS

Reply
Thread Tools Display Modes

IPTables and IIS

 
 
Tony
Guest
Posts: n/a

 
      02-10-2006, 09:03 PM
Hi.

I've a Linux machine acting as a router, and I've a IIS server in my LAN.

I set up these rules to NAT web traffic to IIS server:

iptables -t nat -A POSTROUTING -j MASQUERADE
iptables -t nat -A PREROUTING -p tcp -s ! my_lan_address/24 -d
external_ip --dport 80 -j DNAT --to iis_server_ip:80

it works great, but I cannot see client IP address that is connecting to my
website. IIS shows me Linux IP ethernet address.

How can I setup iptables' rules to show client's IP address to IIS?

Thank you so much for your help.

Tony.


 
Reply With Quote
 
 
 
 
Robert
Guest
Posts: n/a

 
      02-11-2006, 01:56 AM
On Fri, 10 Feb 2006 23:03:45 +0100, Tony wrote:

> I set up these rules to NAT web traffic to IIS server:
>
> iptables -t nat -A POSTROUTING -j MASQUERADE
> iptables -t nat -A PREROUTING -p tcp -s ! my_lan_address/24 -d
> external_ip --dport 80 -j DNAT --to iis_server_ip:80
>
> it works great, but I cannot see client IP address that is connecting to my
> website. IIS shows me Linux IP ethernet address.
>
> How can I setup iptables' rules to show client's IP address to IIS?


First things first. The rule with POSTROUTING, you might want to place
the internet facing interface in this rule. This is why you are only
seeing the Linux IP Address. It's MASQUERADing all traffic no matter
which interface it goes out.


--

Regards
Robert

Smile... it increases your face value!


----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
 
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
about iptables junaidaslam Linux Networking 3 08-29-2005 09:35 PM
Looking for iptables applications code (iptables.c) to run some rules to forward packets tvnaidu@yahoo.com Linux Networking 2 01-17-2005 05:01 PM
iptables Bernd Roth Linux Networking 5 01-16-2005 05:53 PM
iptables and nat Marcin Giedz Linux Networking 5 07-06-2004 07:05 AM
iptables "can't initialize iptables table `filter'" pete Linux Networking 1 10-10-2003 03:44 AM



1 2 3 4 5 6 7 8 9 10 11