* Setting up a proxy with iptables
@ 2008-08-01 23:24 Shawn Fitzgerald
0 siblings, 0 replies; 7+ messages in thread
From: Shawn Fitzgerald @ 2008-08-01 23:24 UTC (permalink / raw)
To: netfilter
Hi,
I am trying to set up a proxy with iptables nothing seems to work. I
would like to forward outbound traffic destined to port 80 on an
external ip address to localhost port 8080.
Thanks in advance for the help.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re:Setting up a proxy with iptables
@ 2008-08-02 7:18 linuxmc
2008-08-02 8:04 ` Setting " Michele Petrazzo - Unipex srl
0 siblings, 1 reply; 7+ messages in thread
From: linuxmc @ 2008-08-02 7:18 UTC (permalink / raw)
To: sargon97; +Cc: netfilter
Hi, have you try with a rule like
$IPTABLES -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT --to-destination 82.109.120.222:8080
?
Best regards !
Marco
---------- Initial Header -----------
From : netfilter-owner@vger.kernel.org
To : netfilter@vger.kernel.org
Cc :
Date : Fri, 1 Aug 2008 16:24:34 -0700
Subject : Setting up a proxy with iptables
> Hi,
>
> I am trying to set up a proxy with iptables nothing seems to work. I
> would like to forward outbound traffic destined to port 80 on an
> external ip address to localhost port 8080.
>
> Thanks in advance for the help.
> --
> 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
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Setting up a proxy with iptables
2008-08-02 7:18 Re:Setting up a proxy with iptables linuxmc
@ 2008-08-02 8:04 ` Michele Petrazzo - Unipex srl
2008-08-04 21:06 ` Shawn Fitzgerald
0 siblings, 1 reply; 7+ messages in thread
From: Michele Petrazzo - Unipex srl @ 2008-08-02 8:04 UTC (permalink / raw)
To: linuxmc@libero.it; +Cc: sargon97, netfilter
linuxmc@libero.it wrote:
> Hi, have you try with a rule like
>
> $IPTABLES -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT
> --to-destination 82.109.120.222:8080
>
> ?
>
> Best regards ! Marco
>
Should be better the redirect target:
$IPTABLES -t nat -A PREROUTING -i $INTERNAL -p tcp --dport 80 -j
REDIRECT --to-ports $PROXY_PORT
$IPTABLES -t nat -A PREROUTING -i $INTERNAL -p tcp --dport 443 -j
REDIRECT --to-ports $PROXY_PORT
Ciao,
MIchele
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Setting up a proxy with iptables
2008-08-02 8:04 ` Setting " Michele Petrazzo - Unipex srl
@ 2008-08-04 21:06 ` Shawn Fitzgerald
2008-08-05 6:31 ` Michele Petrazzo - Unipex srl
0 siblings, 1 reply; 7+ messages in thread
From: Shawn Fitzgerald @ 2008-08-04 21:06 UTC (permalink / raw)
To: Michele Petrazzo - Unipex srl; +Cc: linuxmc@libero.it, netfilter
I did an iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j
REDIRECT --to-ports 8080 and nothing. Just to make sure the firewall
was up I entered iptables -A OUTPUT -j DROP and it did block all
outbound traffic.
What am I missing here?
Cheers, Shawn
On Sat, Aug 2, 2008 at 1:04 AM, Michele Petrazzo - Unipex srl
<michele.petrazzo@unipex.it> wrote:
> linuxmc@libero.it wrote:
>>
>> Hi, have you try with a rule like
>>
>> $IPTABLES -t nat -A PREROUTING -p tcp -m tcp --dport 80 -j DNAT
>> --to-destination 82.109.120.222:8080
>>
>> ?
>>
>> Best regards ! Marco
>>
>
> Should be better the redirect target:
>
> $IPTABLES -t nat -A PREROUTING -i $INTERNAL -p tcp --dport 80 -j REDIRECT
> --to-ports $PROXY_PORT
> $IPTABLES -t nat -A PREROUTING -i $INTERNAL -p tcp --dport 443 -j REDIRECT
> --to-ports $PROXY_PORT
>
>
> Ciao,
> MIchele
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Setting up a proxy with iptables
2008-08-04 21:06 ` Shawn Fitzgerald
@ 2008-08-05 6:31 ` Michele Petrazzo - Unipex srl
2008-08-05 16:46 ` Shawn Fitzgerald
0 siblings, 1 reply; 7+ messages in thread
From: Michele Petrazzo - Unipex srl @ 2008-08-05 6:31 UTC (permalink / raw)
To: Shawn Fitzgerald; +Cc: netfilter
Shawn Fitzgerald wrote:
> I did an iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j
> REDIRECT --to-ports 8080 and nothing. Just to make sure the firewall
> was up I entered iptables -A OUTPUT -j DROP and it did block all
> outbound traffic.
>
> What am I missing here?
>
Nothing it's not an answer.
How it's your lan? How are connected your eth0? Have you log the
incoming packets *before* redirect? Have you tried to tcpdump?
Too little infos...
Michele
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Setting up a proxy with iptables
2008-08-05 6:31 ` Michele Petrazzo - Unipex srl
@ 2008-08-05 16:46 ` Shawn Fitzgerald
2008-08-05 17:28 ` Billy Crook
0 siblings, 1 reply; 7+ messages in thread
From: Shawn Fitzgerald @ 2008-08-05 16:46 UTC (permalink / raw)
To: Michele Petrazzo - Unipex srl; +Cc: netfilter
I have not logged any incoming packets. I only want to redirect
outbound traffic to localhost 8080. I have only one nic card, eth0 and
it is up. Is it possible that some kernel configuration is causing
problems?
Thanks, Shawn
On Mon, Aug 4, 2008 at 11:31 PM, Michele Petrazzo - Unipex srl
<michele.petrazzo@unipex.it> wrote:
> Shawn Fitzgerald wrote:
>>
>> I did an iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j
>> REDIRECT --to-ports 8080 and nothing. Just to make sure the firewall was up
>> I entered iptables -A OUTPUT -j DROP and it did block all outbound traffic.
>>
>> What am I missing here?
>>
>
> Nothing it's not an answer.
> How it's your lan? How are connected your eth0? Have you log the
> incoming packets *before* redirect? Have you tried to tcpdump?
> Too little infos...
>
> Michele
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Setting up a proxy with iptables
2008-08-05 16:46 ` Shawn Fitzgerald
@ 2008-08-05 17:28 ` Billy Crook
0 siblings, 0 replies; 7+ messages in thread
From: Billy Crook @ 2008-08-05 17:28 UTC (permalink / raw)
To: Shawn Fitzgerald; +Cc: Michele Petrazzo - Unipex srl, netfilter
We all thought outbound meant outbound from your network. Your use of
-i eth0 also gave that impression since -i isn't valid for matching
traffic originating on your own machine and travelling out onto the
network. The PREROUTING chain is never matched by traffic originating
on your own box and heading outward. Only the OUTPUT and POSTROUTING
chains are. The REDIRECT target is valid only in REROUTING and
OUTPUT. Try using it in OUTPUT.
On Tue, Aug 5, 2008 at 11:46, Shawn Fitzgerald <sargon97@gmail.com> wrote:
> I have not logged any incoming packets. I only want to redirect
> outbound traffic to localhost 8080. I have only one nic card, eth0 and
> it is up. Is it possible that some kernel configuration is causing
> problems?
>
> Thanks, Shawn
>
> On Mon, Aug 4, 2008 at 11:31 PM, Michele Petrazzo - Unipex srl
> <michele.petrazzo@unipex.it> wrote:
>> Shawn Fitzgerald wrote:
>>>
>>> I did an iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j
>>> REDIRECT --to-ports 8080 and nothing. Just to make sure the firewall was up
>>> I entered iptables -A OUTPUT -j DROP and it did block all outbound traffic.
>>>
>>> What am I missing here?
>>>
>>
>> Nothing it's not an answer.
>> How it's your lan? How are connected your eth0? Have you log the
>> incoming packets *before* redirect? Have you tried to tcpdump?
>> Too little infos...
>>
>> Michele
>>
> --
> 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
>
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-08-05 17:28 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-08-02 7:18 Re:Setting up a proxy with iptables linuxmc
2008-08-02 8:04 ` Setting " Michele Petrazzo - Unipex srl
2008-08-04 21:06 ` Shawn Fitzgerald
2008-08-05 6:31 ` Michele Petrazzo - Unipex srl
2008-08-05 16:46 ` Shawn Fitzgerald
2008-08-05 17:28 ` Billy Crook
-- strict thread matches above, loose matches on Subject: below --
2008-08-01 23:24 Shawn Fitzgerald
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.