V
V
vlad21-022015-10-28 19:50:56
linux
vlad21-02, 2015-10-28 19:50:56

Proxy server on linux?

There is a server with linux, let's say at 12.34.56.78 And there are 100 additional ip addresses. Interested in how you can implement the following chain: the browser specifies the server address with a port, say 12.34.56.78:12345. The server, knowing that there is a specific ip address for a certain port (out of that 100), redirects traffic.
The bottom line is that when accessing the address (12.34.56.78:12345; 12.34.56.78:12346; 12.34.56.78:12347) there should be a redirect through another ip (22.34.56.78; 32.34.56.78; 42.34.56.78)
Tell me, is it possible to do this, if so, please tell me the implementation.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
N
Nadz Goldman, 2015-10-28
@nadz

This can also be done with iptables - it will be faster.
But if you want through a proxy, then the easiest way is with nginx

V
Vlad Zhivotnev, 2015-10-28
@inkvizitor68sl

break-people.ru/cmsmade/index.php?page=translate_s... - hang separate ACLs on each port, hang different tcp_outs on acl.

A
Azazel PW, 2015-10-29
@azazelpw

To redirect traffic from the internal network to the external
iptables -t nat -A POSTROUTING -s destanation_ip -o interface_eth --jump SNAT --to-source ip_gw
To redirect traffic from the external network to the internal
iptables -t nat -A PREROUTING -p protocol_tcp(udp ) -d ip_gw --dport port to which we receive traffic --jump DNAT --to-destination ip_internal:port_to_which_we send_traffic.

A
alexxandr, 2015-10-29
@alexxandr

netcat and no problem :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question