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

Проброс портов Juniper SRX 100

Уважаемые форумчане, помогите найти что не так. Не работает проброс порта. Перекопал всю документацию. Помогите пожалуйста.

 

version 12.1X46-D40.2;
system {
   host-name srx100_1;
   root-authentication {
       encrypted-password "$1$Wyt9BEpJ$T7ECDfFYpuIQYPoaCmjNy."; ## SECRET-DATA
   }
   name-server {
       8.8.8.8;
   }
   login {
       user admin {
           uid 2000;
           class super-user;
           authentication {
               encrypted-password "$1$U.tKjyJY$9s6v./EHIyuYEQGG5LIP1/"; ## SECRET-DATA
           }
       }
   }
   services {
       ssh;
       web-management {
           http {
               interface fe-0/0/1.0;
           }
       }
   }
}
interfaces {
   fe-0/0/0 {
       unit 0 {
           family inet {
               address 111.111.111.111/29;
           }
       }
   }
   fe-0/0/1 {
       unit 0 {
           family inet {
               address 222.222.222.222/21;
           }
       }
   }
}
routing-options {
   static {
       route 0.0.0.0/0 next-hop 111.111.111.112;
   }
}
security {
   address-book {
       global {
           address rdp_server 222.222.222.223/32;
       }
   }
   nat {
       source {
           rule-set trust-to-untrust {
               from zone trust;
               to zone untrust;
               rule source-nat-rule {
                   match {
                       source-address 0.0.0.0/0;
                   }
                   then {
                       source-nat {
                           interface;
                       }
                   }
               }
           }
       }
       destination {
           pool rdp-server {
               address 222.222.222.223/32 port 3389;
           }
           rule-set DNAT {
               from zone untrust;
               rule dnat_for_rdp {
                   match {
                       destination-address 111.111.111.111/32;
                       destination-port 3390;
                   }
                   then {
                       destination-nat {
                           pool {
                               rdp-server;
                           }
                       }
                   }
               }
           }
       }
   }
   policies {
       from-zone trust to-zone untrust {
           policy trust-to-untrust {
               match {
                   source-address any;
                   destination-address any;
                   application any;
               }
               then {
                   permit;
               }
           }
       }
       from-zone untrust to-zone trust {
           policy rdp_access {
               match {
                   source-address any;
                   destination-address rdp_server;
                   application any;
               }
               then {
                   permit {
                       destination-address;
                   }
               }
           }
       }
   }
   zones {
       security-zone trust {
           host-inbound-traffic {
               system-services {
                   all;
               }
               protocols {
                   all;
               }
           }
           interfaces {
               fe-0/0/1.0;
           }
       }
       security-zone untrust {
           interfaces {
               fe-0/0/0.0 {
                   host-inbound-traffic {
                       system-services {
                           ping;
                           ssh;
                       }
                   }
               }
           }
       }
   }
}

Share this post


Link to post
Share on other sites

MonaxGT

 

show sec flow session:

Session ID: 9003, Policy name: rdp_access/5, Timeout: 16, Valid

In: 333.333.333.333/59101 --> 111.111.111.111/3390;tcp, If: fe-0/0/0.0, Pkts: 3, Bytes: 180

Out: 222.222.222.223/3389 --> 333.333.333.333/59101;tcp, If: fe-0/0/1.0, Pkts: 0, Bytes: 0

 

 

show sec nat ru all:

Destination port : 3390

Action : rdp-server

Translation hits : 60

Successful sessions : 60

Number of sessions : 1

Share this post


Link to post
Share on other sites

edit security nat destination
set pool RDP_client address 192.168.1.2 port 3389
set rule-set DNAT from zone untrust
set rule-set DNAT rule dnat_RDP match destination-address 91.*.*.*
set rule-set DNAT rule dnat_RDP match destination-port 3389
set rule-set DNAT rule dnat_RDP then destination-nat pool RDP_client
top edit security address-book global
set address RDP_client 192.168.1.2
top edit security policies from-zone untrust to-zone trust
set policy RDP_access match source-address any
set policy RDP_access match destination-address RDP_client
set policy RDP_access match application any
set policy RDP_access then permit

Edited by FATHER_FBI

Share this post


Link to post
Share on other sites

dit security nat destination

set pool RDP_client address 192.168.1.2 port 3389

set rule-set DNAT from zone untrust

set rule-set DNAT rule dnat_RDP match destination-address 91.*.*.*

set rule-set DNAT rule dnat_RDP match destination-port 3389

set rule-set DNAT rule dnat_RDP then destination-nat pool RDP_client

top edit security address-book global

set address RDP_client 192.168.1.2

top edit security policies from-zone untrust to-zone trust

set policy RDP_access match source-address any

set policy RDP_access match destination-address RDP_client

set policy RDP_access match application any

set policy RDP_access then permit

 

А чем это отличается от моей конфигурации, кроме названий?

Share this post


Link to post
Share on other sites

dit security nat destination

set pool RDP_client address 192.168.1.2 port 3389

set rule-set DNAT from zone untrust

set rule-set DNAT rule dnat_RDP match destination-address 91.*.*.*

set rule-set DNAT rule dnat_RDP match destination-port 3389

set rule-set DNAT rule dnat_RDP then destination-nat pool RDP_client

top edit security address-book global

set address RDP_client 192.168.1.2

top edit security policies from-zone untrust to-zone trust

set policy RDP_access match source-address any

set policy RDP_access match destination-address RDP_client

set policy RDP_access match application any

set policy RDP_access then permit

 

А чем это отличается от моей конфигурации, кроме названий?

Тем что это рабочая конфигурация, которая скопирована с моего джуна

У вас точно RDP сервер слушает порт 3390?

Edited by FATHER_FBI

Share this post


Link to post
Share on other sites

У вас точно RDP сервер слушает порт 3390?

Не сталкивался с джунами но чисто логически если смотреть ТС хочет транслировать запросы на внешний ip и порт 3390 на ip сервера и на порт 3389.

Я вот правда что то запамятовал, а в RDP клиенте порт то можно выставить?

Share this post


Link to post
Share on other sites

У вас точно RDP сервер слушает порт 3390?

Не сталкивался с джунами но чисто логически если смотреть ТС хочет транслировать запросы на внешний ip и порт 3390 на ip сервера и на порт 3389.

Я вот правда что то запамятовал, а в RDP клиенте порт то можно выставить?

Конечно можно

HKEY_LOCAL_MACHINE>SYSTEM>CurrentControlSet>Control>Terminal Server>WinStations>RDP-Tcp>PortNumber

Share this post


Link to post
Share on other sites

show sec flow session:

Session ID: 9003, Policy name: rdp_access/5, Timeout: 16, Valid

In: 333.333.333.333/59101 --> 111.111.111.111/3390;tcp, If: fe-0/0/0.0, Pkts: 3, Bytes: 180

Out: 222.222.222.223/3389 --> 333.333.333.333/59101;tcp, If: fe-0/0/1.0, Pkts: 0, Bytes: 0

 

У вас пакеты ушли в сторону машины, обратно нет - вопрос, а у вас точно работает RDP На машине?

На машине можете снифером трафик половить?

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.