Solved

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

Posted on 1997-06-13
15
295 Views
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
            machine.
  '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
rikardur@skyrr.is - Skyrr Ltd  - Iceland Information Management


0
Comment
Question by:Rikki
  • 8
  • 3
  • 2
  • +2
15 Comments
 

Author Comment

by:Rikki
ID: 1584841
Edited text of question
0
 

Author Comment

by:Rikki
ID: 1584842
Edited text of question
0
 
LVL 1

Expert Comment

by:aldem
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.
0
 
LVL 3

Expert Comment

by:sauron
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.
0
 
LVL 3

Expert Comment

by:vinniew
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.

0
 
LVL 3

Expert Comment

by:vinniew
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.


0
 

Author Comment

by:Rikki
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.

0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

Author Comment

by:Rikki
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
  connection.
* 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.)
*
0
 

Expert Comment

by:olivier_axis
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
0
 

Author Comment

by:Rikki
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.
0
 

Author Comment

by:Rikki
ID: 1584851
Adjusted points to 200
0
 

Author Comment

by:Rikki
ID: 1584852
Adjusted points to 201
0
 

Accepted Solution

by:
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.-> http://www.csn.tu-chemnitz.de/~mha/linux-ip-nat/
0
 

Expert Comment

by:olivier_axis
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
0
 

Author Comment

by:Rikki
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.



0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Join & Write a Comment

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…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

747 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

14 Experts available now in Live!

Get 1:1 Help Now