[Firewall] A *real* transparent proxy anyone ??

Posted on 1997-06-13
Last Modified: 2010-03-17
My setup:
   Internet <--------|Linux Firewall (LF)|------> Internal

  Users on the Internet have to be able to initiate a
  connection to the LF to get a service.
  (Note: the users must give the IP of the LF as the
  host they want to connect to)

  The connection must be forwarded from the LF to a
  machine on the internal network, (The real server)

  The real server must know the real IP of the connecting
  user. (The service in question is an SNA gateway)

  On there way out, the packets must again have there
  source address changed so they appear coming from the LF.

My problem:

  'ipfwadm' only supports redirecting to ports on the local
  'tproxy'  changes the source address.
  'redir'   changes the source address.
  'plug_gw' changes the source address.

  In short: I haven't found a way to do this !

My Solution:

   [This space desperately left blank]
Rikhardur Egilsson  - Domain Administrator - Tel : +354-5695100
Armuli 2 - IS-108   Reykjavik - Iceland  - Fax : +354-5695251 - Skyrr Ltd  - Iceland Information Management

Question by:Rikki
  • 8
  • 3
  • 2
  • +2

Author Comment

ID: 1584841
Edited text of question

Author Comment

ID: 1584842
Edited text of question

Expert Comment

ID: 1584843
As far I know, transparent proxy works fine only for
originator - it will think it connected to real server,
while request will be redirected to other IP address,
and, possible, port.

Expert Comment

ID: 1584844
Ipfwadm with masquerading will do most of this. It'll rewrite the packet IP addresses for you, and give transparent proxying from the inside.

If you get another package, called ipautofw, this should allow you to redirect incoming traffic to a machine inside the firewall. I haven't actually used this, so I'm not 100% sure it'll do what you're looking for, but it's worth checking - it allows forwarding of UDP (and TCP?) datagrams across the firewall.

Expert Comment

ID: 1584845
I don't know if you can do this or not...

I would write an ISAPI server extension (good for NT and PWS) that would query the Linux box and ask him who is connected.

It starts up with a URL mapping.

If you don't have NT/PWS, you could also recompile Apache with code to do the same thing.  I think that there might be a problem keeping track, but if you've got the source for your proxy, you can do something to handle it.

In short, this is a *REAL* project.  Keep looking for something commercial.


Expert Comment

ID: 1584846
Better Idea:

send a string with the IP:port of the user to the http server.  program the server to handle it, remove it.

boom. done.


Author Comment

ID: 1584847
I think 'vinniew' answered the wrong question..  :-)              

At least this answer has nothing to do with the question or
my problem.

I suggest the moderator removes this 'proposed answer' and lets
the question stand as-is.

Give your grad a cloud of their own!

With up to 8TB of storage, give your favorite graduate their own personal cloud to centralize all their photos, videos and music in one safe place. They can save, sync and share all their stuff, and automatic photo backup helps free up space on their smartphone and tablet.


Author Comment

ID: 1584848
Just for the record,

* There is no HTTP server involved in the problem.
* Our customers should connect to the linux firewall (LF)with
  there 'tn3270' clients, such as QVS3270, IRMA or IBM's.
* The LF should act as a gateway and forward there packages
  to the real server (RS) who is running an SNA gateway
  (SNA gateway is a way to connect to a IBM mainframe)
* The SNA gateway needs to get the real IP of the client in the
* Nedless to say I do NOT have the source to HP's SNAplus3270
  product :-(
* The packages need to have there source address changed on
  there way out.

* sauron's comment is a wery good one (I'd give him a few points
  for it if I knew how).  It pointed me to 'ipautofw' witch is
  supposed to solve exactly my problem.  The only drawback is
  that exactly that part of the service hasn't been implemented
  prpperly (yet).  
  (It's the -p switch I'm talking about.)

Expert Comment

ID: 1584849
May be you can use the linux IP tunneling module ?For further details you can read the following files:<YourLinuxSrcDir>/drivers/net/README.tunnel<YourLinuxSrcDir>/drivers/net/new_tunnel.c or tunnel.c

Author Comment

ID: 1584850
According to my <MyLinuxSrcDir>/drivers/net/README.tunnel
The machine that is supposed to appear on my internal network
has to run the tunnel encapsulator 'tunnel.o'.
This means that our customers, would have to do it.
And I'd run the decapsulator 'ipip.o'.
Sorry, but this won't go.

I guess I'l have to read over the sources to 'ipautofw' and see what can be done.

Author Comment

ID: 1584851
Adjusted points to 200

Author Comment

ID: 1584852
Adjusted points to 201

Accepted Solution

olivier_axis earned 200 total points
ID: 1584853
Ok ! Now you can try Linux NAT (Network Adress Translation).The network adress translation table is manageable with a command line program, like ipfwadm.This is experimental & i have not tested it.->

Expert Comment

ID: 1584854
I thing the linux ip address translation is the best way for yourconfiguration and can preserve:  - **The source address** - The destination adress - or both...also, you can translate adresses for one selection of tcp/udp/icmp ports or for all ports

Author Comment

ID: 1584855
This got me into the right direction,  It appears as if I were one of the first to download the IP_NAT package and therefore suffered from the early bugs that have since been corrected.

With a little help from the author I got it to work and here are a few hints as to how:

    * I had to apply the patch (<typo>) mentioned on the WWW
      page. (This one was easy)
    * Routing is done after any changes to the package on the
      inbound port (i.e. if you specify -W <inbound eth>
    * Routing is done before any changes made to the package on
      the outbound port ((i.e. if you specify -W <outbound eth>
    * So you have to specify routing (ipfwadm -F) rules for the
      packages as they are in that middle stage.

IP NAT now seems to work for me 100% of the time.  I have a little problem getting Linux to route back out on the same interface.  That is, I have one network "behind" me, behind one router and it can't get it to route to that router.


Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I have seen several blogs and forum entries elsewhere state that because NTFS volumes do not support linux ownership or permissions, they cannot be used for anonymous ftp upload through the vsftpd program.   IT can be done and here's how to get i…
Note: for this to work properly you need to use a Cross-Over network cable. 1. Connect both servers S1 and S2 on the second network slots respectively. Note that you can use the 1st slots but usually these would be occupied by the Service Provide…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now