Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Как правильно отключить nat чтобы соединить две сети?

    Scheduled Pinned Locked Moved Russian
    8 Posts 4 Posters 656 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      vanohaker
      last edited by

      Всем привет. Помогите решить проблему, а проблема вот в чём.
      Есть три сети
      192.168.1.0/24
      10.200.0.0/30
      10.10.0.0/24

      комп 192.168.1.27/24 подключён к mikrotik с ip адресом 192.168.1.100/24
      на mikrotik создан интерфейс с адресом 10.200.0.1/30 и смотрит в сторону pfsense с адресом 10.200.0.2/30, в общем это как бы магистральная подсеть соединяющая два роутера.
      на pfsense wan интерфейс 10.200.0.2/30, lan интерфейс 10.10.0.1/24 за инм сервер 10.10.0.10/24 с сайтом и всякой шнягой типа ssh, radius и т.п.

      надо добраться из 192.168.1.24 до 10.10.0.10 к web серверу.

      вся схема примерно выглядит так
      192.168.1.27/24 <---> (192.168.1.100/24 --- 10.200.0.1/30 ) <---> ( 10.200.0.2/30 --- 10.10.0.1/24 ) <---> 10.10.0.10/24

      настройки mikrotik

      [admin@R1] /ip route> print 
      Flags: X - disabled, A - active, D - dynamic, C - connect, S - static, r - rip, b - bgp, o - ospf, m - mme, B - blackhole, U - unreachable, P - prohibit 
       #      DST-ADDRESS        PREF-SRC        GATEWAY            DISTANCE
       0 ADS  0.0.0.0/0                          pppoe-out1                1
       1 A S  10.10.0.0/24                       10.200.0.2                1
       2 ADC  10.200.0.0/30      10.200.0.1      br2.200                   0
       3 ADC  178.34.128.37/32   195.160.246.16  pppoe-out1                0
       4 ADC  192.168.1.0/24     192.168.1.100   bridge                    0
       5 ADC  192.168.5.0/24     192.168.5.1     br2.5                     0
       6 ADC  192.168.6.0/24     192.168.6.1     br2.6                     0
       7 ADC  192.168.7.0/24     192.168.7.1     br2.7                     0
       8 ADC  192.168.100.0/24   192.168.100.2   bridge1_iptv              0
      

      интерфейс с магистральной сеткой br2.200

      [admin@R1] /ip address> print 
      Flags: X - disabled, I - invalid, D - dynamic 
       #   ADDRESS            NETWORK         INTERFACE                                                                                                                                                                                           
       0   ;;; defconf
           192.168.1.100/24   192.168.1.0     bridge                                                                                                                                                                                              
       1   192.168.5.1/24     192.168.5.0     br2.5                                                                                                                                                                                               
       2   192.168.100.2/24   192.168.100.0   bridge1_iptv                                                                                                                                                                                        
       3   192.168.6.1/24     192.168.6.0     br2.6                                                                                                                                                                                               
       4   192.168.7.1/24     192.168.7.0     br2.7                                                                                                                                                                                               
       5   ;;; ���� �� pfsense
           10.200.0.1/30      10.200.0.0      br2.200                                                                                                                                                                                             
       6 D xxx.xxx.xxx.xxx/32  xxx.xx.xx.xx   pppoe-out1
      

      от mikrotik 10.10.0.10 пингуется

      [admin@R1] > ping 10.10.0.10
        SEQ HOST                                     SIZE TTL TIME  STATUS                                                                                                                                                                        
          0 10.10.0.10                                 56  63 1ms  
          1 10.10.0.10                                 56  63 0ms  
          2 10.10.0.10                                 56  63 0ms  
          3 10.10.0.10                                 56  63 0ms  
          4 10.10.0.10                                 56  63 0ms  
          sent=5 received=5 packet-loss=0% min-rtt=0ms avg-rtt=0ms max-rtt=1ms 
      
      [admin@R1] > 
      

      трасировка

      [admin@R1] > tool traceroute 10.10.0.10
       # ADDRESS                          LOSS SENT    LAST     AVG    BEST   WORST STD-DEV STATUS                                                                                                                                                
       1 10.200.0.2                         0%    5   0.3ms     0.4     0.3     0.4       0                                                                                                                                                       
       2 10.10.0.10                         0%    5   0.5ms     0.6     0.4     0.9     0.2                                                                                                                                                       
      [admin@R1] >
      

      настройки pfsense
      alt text
      alt text
      alt text
      alt text
      alt text
      alt text

      пинг и трасировка с 192.168.1.27 на 10.10.0.10
      alt text

      попытка ssh c 192.168.1.27 на 10.10.0.10
      alt text
      видно что оно как бы хочет соединится но не может.
      такое чувство что роутеру больно и он с каком то трудом маршрутизирует трафик но при этом нагрузки на него нет.

      если зайти на mikrotik и через него попробовать запустить ssh то эффект тот же.
      пинг с 10.10.0.10 до 192.168.1.27, 10.200.0.1 есть.
      alt text

      в общем работает толко пинг и трасировка.
      ssh из pfsense до 10.10.0.10 работает и из 10.10.0.10 пингуется всё, в том числе и интернет.

      помогите. я не знаю куда копать.

      R K 2 Replies Last reply Reply Quote 0
      • V
        vanohaker
        last edited by

        забыл про настройки nat
        alt text

        1 Reply Last reply Reply Quote 0
        • R
          rubic @vanohaker
          last edited by

          @vanohaker pfSense в виртуалке?

          V 2 Replies Last reply Reply Quote 1
          • K
            Konstanti @vanohaker
            last edited by Konstanti

            @vanohaker

            Запустите tcpdump и посмотрите , что происходит на этапе установления соединения
            Возможно , ошибка в расчете контрольных сумм tcp

            1 Reply Last reply Reply Quote 0
            • V
              vanohaker @rubic
              last edited by

              @rubic да. pfsense на виртуалке.
              mikrotik реальный, c vlan на brige интерфейсе. все vlan-ы точно доходят до виртуалки.
              кроме pfsense на виртуалке висят ещё несколько машин с windows и linux они работают нормально.

              V 1 Reply Last reply Reply Quote 0
              • V
                vanohaker @vanohaker
                last edited by

                @Konstantin
                dump_192.168.1.27.cap
                dump_10.10.0.10.cap

                dump_192.168.1.27 дамп с клиента который хочет подключится по ssh
                dump_10.10.0.10 дамп с сервера

                лог подключения с клиента под спойлером.

                vanohaker@asus-x299-a-i7-7800x:~$ ssh vanohaker@10.10.0.10 -v
                OpenSSH_7.9p1 Ubuntu-10, OpenSSL 1.1.1b 26 Feb 2019
                debug1: Reading configuration data /home/vanohaker/.ssh/config
                debug1: Reading configuration data /etc/ssh/ssh_config
                debug1: /etc/ssh/ssh_config line 19: Applying options for *
                debug1: Connecting to 10.10.0.10 [10.10.0.10] port 22.
                debug1: Connection established.
                debug1: identity file /home/vanohaker/.ssh/id_rsa type 0
                debug1: identity file /home/vanohaker/.ssh/id_rsa-cert type -1
                debug1: identity file /home/vanohaker/.ssh/id_dsa type -1
                debug1: identity file /home/vanohaker/.ssh/id_dsa-cert type -1
                debug1: identity file /home/vanohaker/.ssh/id_ecdsa type -1
                debug1: identity file /home/vanohaker/.ssh/id_ecdsa-cert type -1
                debug1: identity file /home/vanohaker/.ssh/id_ed25519 type -1
                debug1: identity file /home/vanohaker/.ssh/id_ed25519-cert type -1
                debug1: identity file /home/vanohaker/.ssh/id_xmss type -1
                debug1: identity file /home/vanohaker/.ssh/id_xmss-cert type -1
                debug1: Local version string SSH-2.0-OpenSSH_7.9p1 Ubuntu-10
                debug1: Remote protocol version 2.0, remote software version OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
                debug1: match: OpenSSH_7.6p1 Ubuntu-4ubuntu0.3 pat OpenSSH_7.0*,OpenSSH_7.1*,OpenSSH_7.2*,OpenSSH_7.3*,OpenSSH_7.4*,OpenSSH_7.5*,OpenSSH_7.6*,OpenSSH_7.7* compat 0x04000002
                debug1: Authenticating to 10.10.0.10:22 as 'vanohaker'
                debug1: SSH2_MSG_KEXINIT sent
                debug1: SSH2_MSG_KEXINIT received
                debug1: kex: algorithm: curve25519-sha256
                debug1: kex: host key algorithm: ecdsa-sha2-nistp256
                debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
                debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
                debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
                debug1: Server host key: ecdsa-sha2-nistp256 SHA256:c6jud4CRvRpZXZ4tYMa/YH1VujPn6f9iteO1X7ws874
                debug1: Host '10.10.0.10' is known and matches the ECDSA host key.
                debug1: Found key in /home/vanohaker/.ssh/known_hosts:24
                debug1: rekey after 134217728 blocks
                debug1: SSH2_MSG_NEWKEYS sent
                debug1: expecting SSH2_MSG_NEWKEYS
                debug1: SSH2_MSG_NEWKEYS received
                debug1: rekey after 134217728 blocks
                debug1: Will attempt key: /home/vanohaker/.ssh/id_rsa RSA SHA256:DbqlcdNcCaEIeKO50ijIIl2FU8wRtZWUIBPhDDV66lY
                debug1: Will attempt key: /home/vanohaker/.ssh/id_dsa
                debug1: Will attempt key: /home/vanohaker/.ssh/id_ecdsa
                debug1: Will attempt key: /home/vanohaker/.ssh/id_ed25519
                debug1: Will attempt key: /home/vanohaker/.ssh/id_xmss
                debug1: SSH2_MSG_EXT_INFO received
                debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
                debug1: SSH2_MSG_SERVICE_ACCEPT received
                Connection closed by 10.10.0.10 port 22
                vanohaker@asus-x299-a-i7-7800x:~$

                1 Reply Last reply Reply Quote 0
                • V
                  vanohaker @rubic
                  last edited by

                  @rubic спасибо. навели на мысль.
                  помогла галочка Disable hardware checksum offload
                  alt text

                  вот тут про это написано
                  https://docs.netgate.com/pfsense/en/latest/book/config/advanced-networking.html

                  werterW 1 Reply Last reply Reply Quote 0
                  • werterW
                    werter @vanohaker
                    last edited by werter

                    @vanohaker
                    Про ЭТО написано вот тут https://docs.netgate.com/pfsense/en/latest/virtualization/index.html

                    Не трогайте правила Floating без надобности. Удалите свое правило оттуда, если оно там надо аля "шоб було".

                    Зы.

                    ABillS

                    Вы, эээ "провайдер"? ))

                    1 Reply Last reply Reply Quote 0
                    • First post
                      Last post
                    Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.