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

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

Решение Linux

HQ-RTR

Пакет

На некоторых дистрибутивах может потребоваться установить пакет iptables.

apt-get update && apt-get install -y iptables

Интерфейс

Необходимо заменить enp7s1 на интерфейс ISP. Адрес назначения на HQ-SRV.

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.

apt-get update && apt-get install -y iptables

Интерфейс

Необходимо заменить enp7s1 на интерфейс ISP. Адрес назначения на BR-SRV.

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

Решение EcoRouter

HQ-RTR

conf t
ip nat source static tcp 172.16.4.2 8080 192.168.1.2 80
ip nat source static tcp 172.16.4.2 2026 192.168.1.2 2026

BR-RTR

conf t
ip nat source static tcp 172.16.5.2 8080 172.16.2.2 8080
ip nat source static tcp 172.16.5.2 2026 172.16.2.2 2026