readme.md

вывод правил mikrotik для ручного создания портов без upnp

предполагается что адреса хостов и вм зафиксированы через dhcp и вм идут следом за хостом - например хост 192.168.0.100, вм1 .101, вм2 .102

функция принимает параметры - адрес хоста, количество вм, offset/смещения портов вм (узнается через тп/в логе хоста/включив на время upnp)

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

пример работы для хоста с 2 вм, адрес хоста 192.168.0.10, адреса вм 192.168.0.11 и .12

/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=tcp to-addresses=192.168.0.10 dst-port=14309 to-ports=14009 comment="192.168.0.10 host1"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=tcp to-addresses=192.168.0.10 dst-port=14300 to-ports=14030 comment="192.168.0.10 host1"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=tcp to-addresses=192.168.0.10 dst-port=14301 to-ports=14031 comment="192.168.0.10 host1"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=tcp to-addresses=192.168.0.10 dst-port=14409 to-ports=14009 comment="192.168.0.10 host2"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=tcp to-addresses=192.168.0.10 dst-port=14400 to-ports=14040 comment="192.168.0.10 host2"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=tcp to-addresses=192.168.0.10 dst-port=14401 to-ports=14041 comment="192.168.0.10 host2"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=udp to-addresses=192.168.0.11 dst-port=14310 to-ports=14010 comment="192.168.0.10 vm1"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=udp to-addresses=192.168.0.11 dst-port=14311 to-ports=14011 comment="192.168.0.10 vm1"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=udp to-addresses=192.168.0.11 dst-port=14312 to-ports=14012 comment="192.168.0.10 vm1"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=udp to-addresses=192.168.0.11 dst-port=14313 to-ports=14013 comment="192.168.0.10 vm1"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=udp to-addresses=192.168.0.12 dst-port=14410 to-ports=14010 comment="192.168.0.10 vm2"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=udp to-addresses=192.168.0.12 dst-port=14411 to-ports=14011 comment="192.168.0.10 vm2"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=udp to-addresses=192.168.0.12 dst-port=14412 to-ports=14012 comment="192.168.0.10 vm2"
/ip firewall nat add chain=dstnat action=dst-nat in-interface-list=external protocol=udp to-addresses=192.168.0.12 dst-port=14413 to-ports=14013 comment="192.168.0.10 vm2"
Описание

playkey mikrotik port calculator

Конвейеры
0 успешных
0 с ошибкой