Передача IP на Linux действуют как обратный прокси?

Это мог быть запрос Вашего клиента, искажаются прокси? Вы попытались добраться до своего сайта из помещения клиента?

2
задан 18 July 2013 в 02:28
2 ответа

Переадресация IP в Linux - это в основном маршрутизация. Сам по себе он не является прокси-сервером и вообще не изменяет трафик на уровне 3 и выше.

Тем не менее, если вы хотите иметь что-то, что маскирует местоположение трафика, вы можете подумать о настройке NAT с использованием iptables для маскировки. (или исходный NAT) трафик, так что исходный IP-адрес является IP-адресом сервера Linux. Это работает совместно с пересылкой.

Для этого вы должны DNAT входящего трафика (изменить его адрес назначения):

iptables -t nat -A PREROUTING -d ${server_x} -j DNAT --to-destination ${server_y}

Затем вы должны изменить исходный адрес, чтобы скрытый сервер отправлял трафик обратно через пересылку:

iptables -t nat -A POSTROUTING -d ${server_y} -j SNAT --to ${server_x}

Вы также можете рассмотреть возможность прогнозирования их для протокола и порта, если вы этого хотите.

3
ответ дан 3 December 2019 в 09:37

You haven't fully explained the problem you're trying to solve, just how you think you can solve it, then asked for other options... So this answer may be somewhat vague, but I'll give it anyway.

Firstly, for the love of all things holy, AVOID NAT. Please. A unicorn cries everytime a new NAT is created.

Solution 1

If your servers have public IP's, just use routing (IP Forwarding) and appropriate firewall rules (iptables) to control what is allowed through.

For example:

Internet <==> Perimeter (123.45.67.89) <==> Server (98.76.54.321)

Enable IP Forwarding (routing) on the Perimeter host, then put in the firewall rules to only allow the traffic that you want to be able to reach the server, DROP or REJECT all other traffic.

Solution 2

If you really want to "hide" the Server so the "internet" believes it is actually talking to "Perimeter" even though it's actually dealing with "Server", then install proper Reverse Proxy software on "Perimeter" and have it do it's thing. This will require more resources on the Perimeter host, but hides "Server" and avoids NAT (Did I mention to avoid NAT?)

Solution 3

If you really have to because 1 and 2 aren't viable for whatever reason, go with the NAT suggestion.

2
ответ дан 3 December 2019 в 09:37

Теги

Похожие вопросы