| To: | netfilter@lists.netfilter.org |
|---|---|
| Subject: | Re: Matching packets by HTTP header "Host" |
| From: | Pascal Hambourg <pascal.mail@plouf.fr.eu.org> |
| Date: | Tue, 13 Mar 2007 19:38:08 +0100 |
| Delivered-to: | sp-com-lists@consult.net |
| Delivered-to: | netfilter-list1@securepoint.com |
| In-reply-to: | <45F68159.5040606@aldu.net> |
| List-archive: | </pipermail/netfilter> |
| List-help: | <mailto:netfilter-request@lists.netfilter.org?subject=help> |
| List-id: | General discussion and user questions <netfilter.lists.netfilter.org> |
| List-post: | <mailto:netfilter@lists.netfilter.org> |
| List-subscribe: | <https://lists.netfilter.org/mailman/listinfo/netfilter>, <mailto:netfilter-request@lists.netfilter.org?subject=subscribe> |
| List-unsubscribe: | <https://lists.netfilter.org/mailman/listinfo/netfilter>, <mailto:netfilter-request@lists.netfilter.org?subject=unsubscribe> |
| Organization: | Plouf ! |
| References: | <45F68159.5040606@aldu.net> |
| Sender: | netfilter-bounces@lists.netfilter.org |
| User-agent: | Mozilla Thunderbird 1.0.6 (Windows/20050716) |
Hello, Giovanni Lovato a écrit : I'm trying to forward packets to different hosts depending on the "Host" header in HTTP packets, e.g. packets on port 80 requesting "Host: one.example.org" to 192.168.0.1 and all other on port 80 to 192.128.0.2. I did: iptables -t nat -A PREROUTING -p TCP -i eth0 -m string --algo bm - --string "Host: one.example.org" --destination-port 80 -j DNAT - --to-destination 192.168.0.1 iptables -t nat -A PREROUTING -p TCP -i eth0 --destination-port 80 -j DNAT --to-destination 192.168.0.2 But all packets are going to 192.168.0.2. Do I miss something? Rules in the 'nat' table apply only to the first packet of a new connection. NAT operations for the whole connection is determined by the NAT rules applied to the first (SYN) packet of the connection, which does not contain any HTTP payload data such as the "Host" header. So the first rule never matches a packet. As suggested, use a HTTP proxy instead. |
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | RE: Connlimit problem k2.6.18.2 , ipt1.3.7, ArcosCom Linux User |
|---|---|
| Next by Date: | Re: Matching packets by HTTP header "Host", Giovanni Lovato |
| Previous by Thread: | RE: Matching packets by HTTP header "Host", Joris Dobbelsteen |
| Next by Thread: | Re: Matching packets by HTTP header "Host", Giovanni Lovato |
| Indexes: | [Date] [Thread] [Top] [All Lists] |