Find the answer to your Linux question:
Results 1 to 2 of 2
Ok, this is maybe an odd one. I have a system with a single nic and ip address a.b.c.1 (system A) I want to proxy incoming requests to port 80 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2007
    Posts
    1

    iptables proxy with a single interface


    Ok, this is maybe an odd one.
    I have a system with a single nic and ip address a.b.c.1 (system A)
    I want to proxy incoming requests to port 80 to a different system on a different subnet of x.y.z.1 (system B)

    On system a.b.c.1, I am trying the following in my /etc/sysconfig/iptables:
    -----------
    *nat
    -A PREROUTING -p tcp --dport 80 -j DNAT --to x.y.z:80
    COMMIT
    -----------

    This seems to ALMOST work. The request from a client system (System C) go to System A, get rewritten and are received by system B. System B seems to be responding, trying to send to System C directly, but (I think) System C is expecting its response to be from system A, not System B, so it ignores the responses. At least, I see that kind of traffic with tcpdump on each system.

    Any help/ideas here? Perhaps there is a different approach other than iptables too. FWIW, I want System A to be able to proxy http, dns and ftp to System B on a different network.

    Brian

  2. #2
    Linux Newbie framp's Avatar
    Join Date
    Jul 2006
    Location
    Stuttgart, Germany
    Posts
    240
    That should work. Can you ping system B from client C? I expect there is a routing problem to get from C to B and vice versa.
    "Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." Linus Benedict Torvalds

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •