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

    Маршрутизация между OpenVPN соединениями

    Scheduled Pinned Locked Moved Russian
    15 Posts 2 Posters 5.3k 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.
    • werterW
      werter
      last edited by

      Так есть связь или нет?

      1 Reply Last reply Reply Quote 0
      • P
        pakko
        last edited by

        Сам роутер 192.168.167.1 пингуется, а компы, что за за ним - нет.

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

          Разбирайтесь с NAT на OpenWRT.
          GIYF!

          1 Reply Last reply Reply Quote 0
          • P
            pakko
            last edited by

            Да, да, спасибо. Сейчас выполню срочную задачку по работе, и буду смотреть в сторону OpenWRT.

            Твои советы верны, я знаю. Отпишусь, как будут результаты.

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

              Директива iroute в client custom config на pfsense имеется?

              1 Reply Last reply Reply Quote 0
              • P
                pakko
                last edited by

                да

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

                  http://leinonen.org/Softat/How_to_configure_OpenVPN_shared_key_tunnels_using_pfSense_and_OpenWRT.pdf

                  Setup OpenWRT

                  This document assumes that you have working OpenWRT environment. 
                  This document assumes that you have update your OpenWRT packages list access to backports.

                  Step 1. Take ssh session to your OpenWRT box.
                  Step 2. Paste your key file /etc/openvpn directory. (OpenWRT use vi editor. vi help /3/)

                  vi /etc/openvpn/myshared.key

                  -  Inside vi press Esc and then i

                  • Paste y our k ey
                  • Press E sc
                    -  Write :wq! and press enter
                    Step 3. Generate configuration file to /etc/config/ directory

                  dev tun0 # Generate/use tunnel 0
                  proto tcp-client # Use tcp
                  keepalive 10 60 # Some ping like messages
                  persist-tun # Some persist options
                  persist-key # Some persist options
                  ifconfig 10.0.8.2 10.0.8.1 # Tun0 ip-address
                  route 192.168.0.0 255.255.255.0 # Route for corporate network
                  remote 212.212.212.1 1194 # OpenVPN server address
                  resolv-retry infinite # Some Road warrior stuff
                  nobind # We don’t need to specific port number 
                  mute-replay-warnings # Some WLAN stuff
                  secret /etc/openvpn/myshared.key # Where our secret file is located
                  comp-lzo # Enable compression
                  verb 3 # Log verbosity

                  Example. myopenvpn.cfg file

                  Step 4. Generate startup script for /etc/init.d directory.

                  Make sure that tun module is loaded

                  insmod tun

                  Start OpenVPN daemon

                  openvpn –daemon --config /etc/config/openvpn.oma --ifconfig-nowarn

                  Allow traffic to tunnel /4/

                  iptables -A INPUT -i tun+ -j ACCEPT

                  Allow forwarding traffic from tunnel

                  iptables -A FORWARD -i tun+ -j ACCEPT

                  Allow forwarding traffic from br0 interface to tunnel

                  iptables -A FORWARD -i br0 -o tun+ -j ACCEPT

                  Example. S98openvpn file

                  Step 5. Restart your OpenWRT box and watch your pfSense firewall and OpenVPN logs.

                  There should be something like this 
                  Jan 11 12:52:47        openvpn[9494]: Initialization Sequence Completed
                  Jan 11 12:52:46        openvpn[9494]: Peer Connection Initiated with xxx.xxx.xxx.xxx:4356
                  Jan 11 12:52:46        openvpn[9494]: TCPv4_SERVER link remote: xxx.xxx.xxx.xxx:4356
                  Jan 11 12:52:46        openvpn[9494]: TCPv4_SERVER link local (bound): [undef]:1194
                  Jan 11 12:52:46        openvpn[9494]: TCP connection established with xxx.xxx.xxx.xxx:4356

                  1 Reply Last reply Reply Quote 0
                  • P
                    pakko
                    last edited by

                    Большое спасибо за информацию!!!

                    1 Reply Last reply Reply Quote 0
                    • P
                      pakko
                      last edited by

                      как-то странно работает, соединяет только на 3-ий раз. Потом долго не коннектится, потом опять соединится. Неустойчивое решение получается. Офисная сеть и домашняя друг друга видят замечательно. Но, вот с пробросом порта либо объединить OpenVPN сети на стороне pfsense до сих пор не удалось. Может у кого-нибудь работает такая схема?

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

                        как-то странно работает, соединяет только на 3-ий раз. Потом долго не коннектится, потом опять соединится

                        Читайте логи. Выставите verb по-больше, напр., 5.  Будут в логах ошибки - гуглите по ним и разбирайтесь.
                        Включите логирование fw и смотрите там тоже.

                        P.s. Все же есть сомнения в настройках вашей OpenWRT. Копайте ее.

                        P.p.s. Попробуйте сменить схему с OpenVPN на схему с PPTP.

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