Перейти к содержанию

Модуль 2. Задание 8.

Решение

HQ-RTR

iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination 192.168.1.2:80
iptables -t nat -A PREROUTING -p tcp --dport 2026 -j DNAT --to-destination 192.168.1.2:2026
iptables-save >> /etc/sysconfig/iptables
systemctl restart iptables

BR-RTR

iptables -t nat -A PREROUTING -p tcp --dport 8080 -j DNAT --to-destination 192.168.3.2:8080
iptables -t nat -A PREROUTING -p tcp --dport 2026 -j DNAT --to-destination 192.168.3.2:2026
iptables-save >> /etc/sysconfig/iptables
systemctl restart iptables