Networking Forums

Networking Forums > Computer Networking > Linux Networking > iptables proxy two ips for one host

Reply
Thread Tools Display Modes

iptables proxy two ips for one host

 
 
Fritz Bayer
Guest
Posts: n/a

 
      07-09-2004, 09:37 AM
Hi,

I'm trying to forward http connections from my browser to a
transparent proxy on the SAME machine and could need some advice.

I have one linux box on the lan with one ethernet card, which I have
assigned the ip address 192.168.1.4 to.

For my purpose I need a second ip address, which I created using the
following commmand:

ifconfig eth0:1 192.168.1.5

The transparent proxy, which I have written myself, is bound to the ip
address 192.168.1.5 on port 8000.

I only have one PC in the lan. I would like to forward all http
connections of my browser to the proxy on the same pc.

In order to achieve this I have to be able distiniguish between http
connections originating from my browser and those originating from the
proxy!

I hoped that the follwing iptable rule would do the job, but it does
not work 100%. Maybe you can help me here:

iptables -t nat -A OUTPUT -o eth0 -p tcp --source 192.168.1.4 --dport
80 -j DNAT --to-destination 192.168.1.5:8000

Now, when I open a URL with my browser, then my proxy actually gets an
incoming connection. So forwarding from the browser to the proxy seems
to work.

However, the outgoing connections of the proxy bounce back. They
reenter the proxy and do not get sent to the internet.

I thought I would prohibit this by using "--source 192.168.1.4" but it
does not work. Can somebody tell me what I should do?
 
Reply With Quote
 
 
 
 
Yas
Guest
Posts: n/a

 
      07-09-2004, 01:25 PM
Have a look at http://en.tldp.org/HOWTO/TransparentProxy.html, I read this
document and i configured a transparent proxy first time without any
issues
)

If you still have problems gimme a shout, and i will try and help were i
can

Yas

On Fri, 09 Jul 2004 02:37:48 -0700, Fritz Bayer wrote:

> Hi,
>
> I'm trying to forward http connections from my browser to a
> transparent proxy on the SAME machine and could need some advice.
>
> I have one linux box on the lan with one ethernet card, which I have
> assigned the ip address 192.168.1.4 to.
>
> For my purpose I need a second ip address, which I created using the
> following commmand:
>
> ifconfig eth0:1 192.168.1.5
>
> The transparent proxy, which I have written myself, is bound to the ip
> address 192.168.1.5 on port 8000.
>
> I only have one PC in the lan. I would like to forward all http
> connections of my browser to the proxy on the same pc.
>
> In order to achieve this I have to be able distiniguish between http
> connections originating from my browser and those originating from the
> proxy!
>
> I hoped that the follwing iptable rule would do the job, but it does
> not work 100%. Maybe you can help me here:
>
> iptables -t nat -A OUTPUT -o eth0 -p tcp --source 192.168.1.4 --dport
> 80 -j DNAT --to-destination 192.168.1.5:8000
>
> Now, when I open a URL with my browser, then my proxy actually gets an
> incoming connection. So forwarding from the browser to the proxy seems
> to work.
>
> However, the outgoing connections of the proxy bounce back. They
> reenter the proxy and do not get sent to the internet.
>
> I thought I would prohibit this by using "--source 192.168.1.4" but it
> does not work. Can somebody tell me what I should do?


 
Reply With Quote
 
Fritz Bayer
Guest
Posts: n/a

 
      07-12-2004, 06:50 AM
Yas <(E-Mail Removed)> wrote in message news:<(E-Mail Removed). uk>...
> Have a look at http://en.tldp.org/HOWTO/TransparentProxy.html, I read this
> document and i configured a transparent proxy first time without any
> issues
> )


I have already read this before, but it does not apply to my problem.
 
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
ssh forward connection from one host with no proxy Claudio Miranda Linux Networking 4 10-03-2008 10:28 AM
Whitelisting a host with iptables Geico Caveman Linux Networking 0 09-28-2006 09:04 PM
iptables, proxy ftp via frox jacob.saxberg@gmail.com Linux Networking 0 04-06-2006 01:20 PM
iptables transparent proxy Cameron Kerr Linux Networking 7 06-14-2004 08:57 AM
Proxy and iptables Francesc Llop Linux Networking 1 04-21-2004 07:57 AM



1 2 3 4 5 6 7 8 9 10 11