Re: NAT issue with iptable
crowl_at_gmx.de
Date: 06/22/05
- Next message: VJayMeyer_at_gmail.com: "Re: how to find a local printer on a network"
- Previous message: James Knott: "Re: Broadcast Address as Gateway"
- In reply to: Bill Davidsen: "Re: NAT issue with iptable"
- Next in thread: Bill Davidsen: "Re: NAT issue with iptable"
- Reply: Bill Davidsen: "Re: NAT issue with iptable"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 22 Jun 2005 05:32:37 -0700
> > I am using iptables for nat.
> > iptables -t nat -A POSTROUTING -o $IFACE_EXT -j MASQUERADE
> > iptables -A INPUT -i $IFACE_EXT -s $myPublicIP -j ACCEPT
>
>
> You accept packets from external machines pretending to be your ext-IP?
> Why? Who is sending them?
Sorry for the confusion. In fact $myPublicIP is the IP range provided
by our ISP. $IFACE_EXT is eth0 and is bind to two IP addressed. One IP
from $myPublicIP and one from our private IP range 192.168.x.x.
$IFACE_EXT is in our DMZ. The machine has also a second nic which is
connected with our intranet protected by iptables. In $myPublicIP range
exist two machines we need for testing purposes. Therefore we have this
second rule. I know I have to be more specific with this rule. But this
adjustment was a quick hack for testing purposes during setup the DMZ.
I think we can neglect the second rule, because it is not important for
the original issue, isn't it? Once again, sorry for the confusion.
> > iptables -t nat -A PREROUTING -i $IFACE_EXT -p tcp -d $myPublicIP
> > --dport 443 -j DNAT --to-destination $myInternalWebserver
>
>
> > Issue: In the web server logs I get only the ip of myPublicIP. It seems
> > that nat rewrite the original ip address. The original ip of the client
> > is very important for the running web server application.
>
> > How can I avoid the rewrite of the original ip address?
>
> Run tcpdump on all NICs, You would see this if you were using the
> external NIC to talk to the "$myInternalWebserver" and using the MASQ.
I am a little bit confused about that. I have run tcpdump and see the
IP from the external client. I am not familiar with tcpdump maybe I
overlook something. But how can tcpdump help me to solve my issue (see
the IP address of the client in the logs of the webserver and in the
running applications instead of the IP of the machine itself)? Or
should tcpdump give me a clue to find the right way?
>
> > Thanks for your help.
>
> Not much help, I don't understand the 2nd rule. But you should just
> trace this all out, and display the overall packet flow to understand
> what's happening.
Thanks for your assistance.
cl
- Next message: VJayMeyer_at_gmail.com: "Re: how to find a local printer on a network"
- Previous message: James Knott: "Re: Broadcast Address as Gateway"
- In reply to: Bill Davidsen: "Re: NAT issue with iptable"
- Next in thread: Bill Davidsen: "Re: NAT issue with iptable"
- Reply: Bill Davidsen: "Re: NAT issue with iptable"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|