Linux Netfilter discussions
 help / color / mirror / Atom feed
* Howto capture first connection and redirect ???
       [not found] <59420160801231515j3e5f71dao58d8a5f89c7114ec@mail.gmail.com>
@ 2008-01-23 23:21 ` Francisco Morales
  2008-01-23 23:29   ` Martijn Lievaart
  0 siblings, 1 reply; 2+ messages in thread
From: Francisco Morales @ 2008-01-23 23:21 UTC (permalink / raw)
  To: netfilter

Hello, I would like to know if does it possible to capture just the
first connection og one user with a iptables rule and redirect to a
specific ip/port address.

I have a intranet with a proxy machine with squid on debian for to out
to internet, and I would like that when I user connect for first time,
a iptable rule redirect it to a welcome page.... but just the first
time ..

Does it possible to do this with a iptable rule??

Thanks a lot

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Howto capture first connection and redirect ???
  2008-01-23 23:21 ` Howto capture first connection and redirect ??? Francisco Morales
@ 2008-01-23 23:29   ` Martijn Lievaart
  0 siblings, 0 replies; 2+ messages in thread
From: Martijn Lievaart @ 2008-01-23 23:29 UTC (permalink / raw)
  To: Francisco Morales; +Cc: netfilter

Francisco Morales wrote:
> Hello, I would like to know if does it possible to capture just the
> first connection og one user with a iptables rule and redirect to a
> specific ip/port address.
>
> I have a intranet with a proxy machine with squid on debian for to out
> to internet, and I would like that when I user connect for first time,
> a iptable rule redirect it to a welcome page.... but just the first
> time ..
>
> Does it possible to do this with a iptable rule??
>
> Thanks a lot
> -
> To unsubscribe from this list: send the line "unsubscribe netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>   

This is probably possible with the recent match. Somthing along these 
lines (untested!):

-t mangle -A PREROUTING -p tcp -dport 80 ! -m recent --update --seconds 
3600 -j REDIRECT --to <welcome-page>

HTH,
M4


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-01-23 23:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <59420160801231515j3e5f71dao58d8a5f89c7114ec@mail.gmail.com>
2008-01-23 23:21 ` Howto capture first connection and redirect ??? Francisco Morales
2008-01-23 23:29   ` Martijn Lievaart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox