Jump to content
Калькуляторы

NAT - редирект порта проброс порта lan to lan

здравствуйте

такая задача: 192.168.1.2:9999 перебрасывать на 192.168.1.2:99

 

на данный момент для внешки настроено вот так:

chain=dstnat action=netmap to-addresses=192.168.1.2 to-ports=99

protocol=tcp in-interface=eth0 dst-port=9999 log=no log-prefix=""

 

и это работает. и цель сделать то же самое, что и с внешки, только для внутрисети, чтобы я мог из сетки обратиться по 9999 порту и чтобы эффект был, будто я стучу на 99.

 

подскажите, пж, а то чето всяко-разно пробовал, не получается

Edited by lddnsk

Share this post


Link to post
Share on other sites

да в одной и той же сети айпишники. "откуда" и "куда". зачем маскарадинг?

Ну и о каком маппинге роутером тогда речь, если вы в одном l2?

Share this post


Link to post
Share on other sites

да в одной и той же сети айпишники. "откуда" и "куда". зачем маскарадинг?

Вы статьи перечитайте - поймете зачем маскарадинг. Там пошагово расписаны причины.

Share this post


Link to post
Share on other sites

Я делаю так

add action=netmap chain=dstnat dst-address=!10.24.1.240 dst-address-type=local dst-port=3389 protocol=tcp to-addresses=10.24.1.252

add action=masquerade chain=srcnat dst-address=10.24.1.252 dst-port=3389 out-interface=bridge protocol=tcp src-address=10.24.1.0/24

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.