На главную Наши проекты:
Журнал   ·   Discuz!ML   ·   Wiki   ·   DRKB   ·   Помощь проекту
ПРАВИЛА FAQ Помощь Участники Календарь Избранное RSS
msm.ru
  
> Openwrt проброс порта , Не пробрасывается порт
    Ситуация такая, есть TP-LINK TL-MR3420 с установленной openwrt 12.09
    К нему подключены такие сети:
    OpenVPN: 192.168.3.0
    Lan+Wi-fi: 192.168.0.0
    WAN: 192.168.4.0

    Интернет берется с WAN соответственно.
    Основной ip роутера: 192.168.0.1
    ip роутера от openvpn: 192.168.3.2
    ip роутера от WAN: 192.168.4.100

    Так вот! Из WAN интерфейса на 192.168.4.100 проброшен порт 1313 по TCP
    то что порт проброшен это 100% так как подключал этот WAN напрямую к компу и открывал порт, с интернета всем его видно.

    Так вот, теперь я беру роутер и с роутера этот порт 1313 пытаюсь пробросить в локальную сеть на ip 192.168.0.199.
    Вроде все просто! но не работает!

    Кратко задача выглядет так:
    WAN-192.168.4.100:1313 --> LAN-192.168.0.199:1313

    Соответственно я создал проброс порта в фаирволе. Вот скрины :
    Скрытый текст

    user posted image

    user posted image




    И вот файл /etc/config/firewall:
    ExpandedWrap disabled
      config defaults
              option input 'ACCEPT'
              option output 'ACCEPT'
              option forward 'ACCEPT'
       
      config include
              option path '/etc/firewall.user'
       
      config zone
              option input 'ACCEPT'
              option forward 'ACCEPT'
              option output 'ACCEPT'
              option masq '1'
              option name 'lan'
              option network 'VPN lan'
       
      config zone
              option input 'ACCEPT'
              option forward 'ACCEPT'
              option output 'ACCEPT'
              option name 'internet'
              option masq '1'
              option network 'WAN'
       
      config forwarding
              option dest 'lan'
              option src 'internet'
       
      config forwarding
              option dest 'internet'
              option src 'lan'
       
      config zone
              option input 'ACCEPT'
              option forward 'ACCEPT'
              option output 'ACCEPT'
              option network '3G'
              option name '3G_zone'
       
      config redirect
              option target 'DNAT'
              option dest 'lan'
              option proto 'tcp udp'
              option src_dport '1313'
              option dest_ip '192.168.0.199'
              option dest_port '1313'
              option name '1313'
              option src 'internet'



    Скажите что я делаю не так? Порт не пробрасывается
      Я в конфиге не вижу зоны 192.168.0.0, то что в нем называется lan принадлежит зоне 192.168.3.0, похоже, куда и выполняется перенаправление.

      Цитата
      config zone
      option input 'ACCEPT'
      option forward 'ACCEPT'
      option output 'ACCEPT'
      option masq '1'
      option name 'lan'
      option network 'VPN lan'

      config zone
      option input 'ACCEPT'
      option forward 'ACCEPT'
      option output 'ACCEPT'
      option name 'internet'
      option masq '1'
      option network 'WAN'


      Цитата
      config redirect
      option target 'DNAT'
      option dest 'lan'
      option proto 'tcp udp'
      option src_dport '1313'
      option dest_ip '192.168.0.199'
      option dest_port '1313'
      option name '1313'
      option src 'internet'
      Сообщение отредактировано: simsergey -
        Разделил зоны эффект тот же

        ExpandedWrap disabled
          config defaults
              option input 'ACCEPT'
              option output 'ACCEPT'
              option forward 'ACCEPT'
              option syn_flood '1'
           
          config include
              option path '/etc/firewall.user'
           
          config zone
              option input 'ACCEPT'
              option forward 'ACCEPT'
              option output 'ACCEPT'
              option masq '1'
              option name 'lan'
              option network 'lan'
           
          config zone
              option input 'ACCEPT'
              option forward 'ACCEPT'
              option output 'ACCEPT'
              option name 'internet'
              option masq '1'
              option network 'WAN'
           
          config forwarding
              option dest 'internet'
              option src 'lan'
           
          config zone
              option input 'ACCEPT'
              option forward 'ACCEPT'
              option output 'ACCEPT'
              option network '3G'
              option name '3G_zone'
           
          config forwarding
              option dest 'lan'
              option src 'internet'
           
          config zone
              option input 'ACCEPT'
              option forward 'ACCEPT'
              option output 'ACCEPT'
              option name 'VPN'
              option network 'VPN'
              option masq '1'
           
          config forwarding
              option dest 'VPN'
              option src 'internet'
           
          config forwarding
              option dest 'VPN'
              option src 'lan'
           
          config forwarding
              option dest 'internet'
              option src 'VPN'
           
          config forwarding
              option dest 'lan'
              option src 'VPN'
           
          config redirect
              option target 'DNAT'
              option src 'wan'
              option dest 'lan'
              option proto 'tcp udp'
              option src_dport '1313'
              option dest_ip '192.168.0.119'
              option dest_port '1313'
              option name '1313'
          В этом году освоил мощь "iptables" ничего сложного кроме основ.
          Сделайте команду, и пришлите сюда вывод:
          iptables -t filter -L
          iptables -t nat -L

          и за одно route, мне так проще.
            Я малость переделал, теперь мне нужно получить с
            WWAN-10.50.50.235:22656 --> LAN-192.168.0.199:22656

            Но суть та же

            ExpandedWrap disabled
              Chain INPUT (policy ACCEPT)
              target     prot opt source               destination        
              ACCEPT     all  --  anywhere             anywhere            ctstate RELATED,ESTABLISHED
              ACCEPT     all  --  anywhere             anywhere            
              syn_flood  tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
              input_rule  all  --  anywhere             anywhere            
              input      all  --  anywhere             anywhere            
               
              Chain FORWARD (policy ACCEPT)
              target     prot opt source               destination        
              ACCEPT     all  --  anywhere             anywhere            ctstate RELATED,ESTABLISHED
              forwarding_rule  all  --  anywhere             anywhere            
              forward    all  --  anywhere             anywhere            
               
              Chain OUTPUT (policy ACCEPT)
              target     prot opt source               destination        
              ACCEPT     all  --  anywhere             anywhere            ctstate RELATED,ESTABLISHED
              ACCEPT     all  --  anywhere             anywhere            
              output_rule  all  --  anywhere             anywhere            
              output     all  --  anywhere             anywhere            
               
              Chain forward (1 references)
              target     prot opt source               destination        
              zone_lan_forward  all  --  anywhere             anywhere            
              zone_3G_zone_forward  all  --  anywhere             anywhere            
              zone_VPN_forward  all  --  anywhere             anywhere            
              zone_internet_forward  all  --  anywhere             anywhere            
              zone_wwan_forward  all  --  anywhere             anywhere            
               
              Chain forwarding_3G_zone (1 references)
              target     prot opt source               destination        
               
              Chain forwarding_VPN (1 references)
              target     prot opt source               destination        
               
              Chain forwarding_internet (1 references)
              target     prot opt source               destination        
               
              Chain forwarding_lan (1 references)
              target     prot opt source               destination        
               
              Chain forwarding_rule (1 references)
              target     prot opt source               destination        
              nat_reflection_fwd  all  --  anywhere             anywhere            
               
              Chain forwarding_wwan (1 references)
              target     prot opt source               destination        
               
              Chain input (1 references)
              target     prot opt source               destination        
              zone_lan   all  --  anywhere             anywhere            
              zone_3G_zone  all  --  anywhere             anywhere            
              zone_VPN   all  --  anywhere             anywhere            
              zone_internet  all  --  anywhere             anywhere            
              zone_wwan  all  --  anywhere             anywhere            
               
              Chain input_3G_zone (1 references)
              target     prot opt source               destination        
               
              Chain input_VPN (1 references)
              target     prot opt source               destination        
               
              Chain input_internet (1 references)
              target     prot opt source               destination        
               
              Chain input_lan (1 references)
              target     prot opt source               destination        
               
              Chain input_rule (1 references)
              target     prot opt source               destination        
               
              Chain input_wwan (1 references)
              target     prot opt source               destination        
               
              Chain nat_reflection_fwd (1 references)
              target     prot opt source               destination        
              ACCEPT     tcp  --  192.168.0.0/24       192.168.0.119       tcp dpt:22656 /* wwan */
               
              Chain output (1 references)
              target     prot opt source               destination        
              zone_lan_ACCEPT  all  --  anywhere             anywhere            
              zone_internet_ACCEPT  all  --  anywhere             anywhere            
              zone_3G_zone_ACCEPT  all  --  anywhere             anywhere            
              zone_VPN_ACCEPT  all  --  anywhere             anywhere            
              zone_wwan_ACCEPT  all  --  anywhere             anywhere            
               
              Chain output_rule (1 references)
              target     prot opt source               destination        
               
              Chain reject (10 references)
              target     prot opt source               destination        
              REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset
              REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable
               
              Chain syn_flood (1 references)
              target     prot opt source               destination        
              RETURN     tcp  --  anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50
              DROP       all  --  anywhere             anywhere            
               
              Chain zone_3G_zone (1 references)
              target     prot opt source               destination        
              input_3G_zone  all  --  anywhere             anywhere            
              zone_3G_zone_ACCEPT  all  --  anywhere             anywhere            
               
              Chain zone_3G_zone_ACCEPT (3 references)
              target     prot opt source               destination        
              ACCEPT     all  --  anywhere             anywhere            
              ACCEPT     all  --  anywhere             anywhere            
               
              Chain zone_3G_zone_DROP (0 references)
              target     prot opt source               destination        
              DROP       all  --  anywhere             anywhere            
              DROP       all  --  anywhere             anywhere            
               
              Chain zone_3G_zone_REJECT (0 references)
              target     prot opt source               destination        
              reject     all  --  anywhere             anywhere            
              reject     all  --  anywhere             anywhere            
               
              Chain zone_3G_zone_forward (1 references)
              target     prot opt source               destination        
              forwarding_3G_zone  all  --  anywhere             anywhere            
              zone_3G_zone_ACCEPT  all  --  anywhere             anywhere            
               
              Chain zone_VPN (1 references)
              target     prot opt source               destination        
              input_VPN  all  --  anywhere             anywhere            
              zone_VPN_ACCEPT  all  --  anywhere             anywhere            
               
              Chain zone_VPN_ACCEPT (6 references)
              target     prot opt source               destination        
              ACCEPT     all  --  anywhere             anywhere            
              ACCEPT     all  --  anywhere             anywhere            
               
              Chain zone_VPN_DROP (0 references)
              target     prot opt source               destination        
              DROP       all  --  anywhere             anywhere            
              DROP       all  --  anywhere             anywhere            
               
              Chain zone_VPN_REJECT (0 references)
              target     prot opt source               destination        
              reject     all  --  anywhere             anywhere            
              reject     all  --  anywhere             anywhere            
               
              Chain zone_VPN_forward (1 references)
              target     prot opt source               destination        
              zone_wwan_ACCEPT  all  --  anywhere             anywhere            
              zone_lan_ACCEPT  all  --  anywhere             anywhere            
              zone_internet_ACCEPT  all  --  anywhere             anywhere            
              forwarding_VPN  all  --  anywhere             anywhere            
              zone_VPN_ACCEPT  all  --  anywhere             anywhere            
               
              Chain zone_internet (1 references)
              target     prot opt source               destination        
              input_internet  all  --  anywhere             anywhere            
              zone_internet_ACCEPT  all  --  anywhere             anywhere            
               
              Chain zone_internet_ACCEPT (5 references)
              target     prot opt source               destination        
              ACCEPT     all  --  anywhere             anywhere            
              ACCEPT     all  --  anywhere             anywhere            
               
              Chain zone_internet_DROP (0 references)
              target     prot opt source               destination        
              DROP       all  --  anywhere             anywhere            
              DROP       all  --  anywhere             anywhere            
               
              Chain zone_internet_REJECT (0 references)
              target     prot opt source               destination        
              reject     all  --  anywhere             anywhere            
              reject     all  --  anywhere             anywhere            
               
              Chain zone_internet_forward (1 references)
              target     prot opt source               destination        
              zone_VPN_ACCEPT  all  --  anywhere             anywhere            
              zone_lan_ACCEPT  all  --  anywhere             anywhere            
              forwarding_internet  all  --  anywhere             anywhere            
              zone_internet_ACCEPT  all  --  anywhere             anywhere            
               
              Chain zone_lan (1 references)
              target     prot opt source               destination        
              input_lan  all  --  anywhere             anywhere            
              zone_lan_ACCEPT  all  --  anywhere             anywhere            
               
              Chain zone_lan_ACCEPT (6 references)
              target     prot opt source               destination        
              ACCEPT     all  --  anywhere             anywhere            
              ACCEPT     all  --  anywhere             anywhere            
               
              Chain zone_lan_DROP (0 references)
              target     prot opt source               destination        
              DROP       all  --  anywhere             anywhere            
              DROP       all  --  anywhere             anywhere            
               
              Chain zone_lan_REJECT (0 references)
              target     prot opt source               destination        
              reject     all  --  anywhere             anywhere            
              reject     all  --  anywhere             anywhere            
               
              Chain zone_lan_forward (1 references)
              target     prot opt source               destination        
              zone_wwan_ACCEPT  all  --  anywhere             anywhere            
              zone_VPN_ACCEPT  all  --  anywhere             anywhere            
              zone_internet_ACCEPT  all  --  anywhere             anywhere            
              forwarding_lan  all  --  anywhere             anywhere            
              zone_lan_ACCEPT  all  --  anywhere             anywhere            
               
              Chain zone_wwan (1 references)
              target     prot opt source               destination        
              input_wwan  all  --  anywhere             anywhere            
              zone_wwan_ACCEPT  all  --  anywhere             anywhere            
               
              Chain zone_wwan_ACCEPT (5 references)
              target     prot opt source               destination        
              ACCEPT     all  --  anywhere             anywhere            
              ACCEPT     all  --  anywhere             anywhere            
               
              Chain zone_wwan_DROP (0 references)
              target     prot opt source               destination        
              DROP       all  --  anywhere             anywhere            
              DROP       all  --  anywhere             anywhere            
               
              Chain zone_wwan_REJECT (0 references)
              target     prot opt source               destination        
              reject     all  --  anywhere             anywhere            
              reject     all  --  anywhere             anywhere            
               
              Chain zone_wwan_forward (1 references)
              target     prot opt source               destination        
              ACCEPT     tcp  --  anywhere             192.168.0.119       tcp dpt:22656
              zone_lan_ACCEPT  all  --  anywhere             anywhere            
              zone_VPN_ACCEPT  all  --  anywhere             anywhere            
              forwarding_wwan  all  --  anywhere             anywhere            
              zone_wwan_ACCEPT  all  --  anywhere             anywhere


            ExpandedWrap disabled
              Chain PREROUTING (policy ACCEPT)
              target     prot opt source               destination        
              prerouting_rule  all  --  anywhere             anywhere            
              zone_lan_prerouting  all  --  anywhere             anywhere            
              zone_3G_zone_prerouting  all  --  anywhere             anywhere            
              zone_VPN_prerouting  all  --  anywhere             anywhere            
              zone_internet_prerouting  all  --  anywhere             anywhere            
              zone_wwan_prerouting  all  --  anywhere             anywhere            
               
              Chain INPUT (policy ACCEPT)
              target     prot opt source               destination        
               
              Chain OUTPUT (policy ACCEPT)
              target     prot opt source               destination        
               
              Chain POSTROUTING (policy ACCEPT)
              target     prot opt source               destination        
              postrouting_rule  all  --  anywhere             anywhere            
              zone_lan_nat  all  --  anywhere             anywhere            
              zone_3G_zone_nat  all  --  anywhere             anywhere            
              zone_VPN_nat  all  --  anywhere             anywhere            
              zone_internet_nat  all  --  anywhere             anywhere            
              zone_wwan_nat  all  --  anywhere             anywhere            
               
              Chain nat_reflection_in (1 references)
              target     prot opt source               destination        
              DNAT       tcp  --  192.168.0.0/24       10.50.50.235        tcp dpt:22656 /* wwan */ to:192.168.0.119:22656
               
              Chain nat_reflection_out (1 references)
              target     prot opt source               destination        
              SNAT       tcp  --  192.168.0.0/24       192.168.0.119       tcp dpt:22656 /* wwan */ to:192.168.0.1
               
              Chain postrouting_rule (1 references)
              target     prot opt source               destination        
              nat_reflection_out  all  --  anywhere             anywhere            
               
              Chain prerouting_3G_zone (1 references)
              target     prot opt source               destination        
               
              Chain prerouting_VPN (1 references)
              target     prot opt source               destination        
               
              Chain prerouting_internet (1 references)
              target     prot opt source               destination        
               
              Chain prerouting_lan (1 references)
              target     prot opt source               destination        
               
              Chain prerouting_rule (1 references)
              target     prot opt source               destination        
              nat_reflection_in  all  --  anywhere             anywhere            
               
              Chain prerouting_wwan (1 references)
              target     prot opt source               destination        
               
              Chain zone_3G_zone_nat (1 references)
              target     prot opt source               destination        
               
              Chain zone_3G_zone_prerouting (1 references)
              target     prot opt source               destination        
              prerouting_3G_zone  all  --  anywhere             anywhere            
               
              Chain zone_VPN_nat (1 references)
              target     prot opt source               destination        
              MASQUERADE  all  --  anywhere             anywhere            
               
              Chain zone_VPN_prerouting (1 references)
              target     prot opt source               destination        
              prerouting_VPN  all  --  anywhere             anywhere            
               
              Chain zone_internet_nat (1 references)
              target     prot opt source               destination        
              MASQUERADE  all  --  anywhere             anywhere            
               
              Chain zone_internet_prerouting (1 references)
              target     prot opt source               destination        
              prerouting_internet  all  --  anywhere             anywhere            
               
              Chain zone_lan_nat (1 references)
              target     prot opt source               destination        
              MASQUERADE  all  --  anywhere             anywhere            
               
              Chain zone_lan_prerouting (1 references)
              target     prot opt source               destination        
              prerouting_lan  all  --  anywhere             anywhere            
               
              Chain zone_wwan_nat (1 references)
              target     prot opt source               destination        
              MASQUERADE  all  --  anywhere             anywhere            
               
              Chain zone_wwan_prerouting (1 references)
              target     prot opt source               destination        
              DNAT       tcp  --  anywhere             anywhere            tcp dpt:22656 to:192.168.0.119:22656
              prerouting_wwan  all  --  anywhere             anywhere


            Добавлено
            И вот ip route
            ExpandedWrap disabled
              default via 10.50.50.1 dev wlan0  proto static
              10.50.50.0/24 dev wlan0  proto kernel  scope link  src 10.50.50.235
              192.168.0.0/24 dev br-lan  proto kernel  scope link  src 192.168.0.1
              192.168.3.0/24 via 192.168.3.1 dev tap0
              192.168.3.0/24 dev tap0  proto kernel  scope link  src 192.168.3.2
              192.168.4.0/24 dev eth1  proto kernel  scope link  src 192.168.4.100
            Сообщение отредактировано: cpp_and_asm -
              cpp_and_asm
              На роутере у вас всё открыто.

              Но тут есть один момент. Который я бы решал настройкой виндоуса. Это проще.
              В виндоусе сейчас сложная система фильтрации. Она динамическая и зависит от выбора типа сети "Общее место", "Рабочее(Доменная)", "Домашняя".
              А также идёт проверка удаленный адрес(адреса приемника) он должен совпадать с локальной сетью. Когда вы подключаете wan напрямую то там локальная сеть совпадает с глобальной сетью. А вот через роутер не совпадает поэтому и блокируется.

              Добавлено
              PS. Создал правило в Виндоусе, так там ещё и NAT блокируется. Вот где собака порылась!

              Добавлено
              user posted image
              загрузить картинку на сайт
              Сообщение отредактировано: Pavia -
                Брандмауэр у меня вообще выключен
                  Ладно. Люди! Я нарисовал свою сеть, и варианты подключения.
                  Общий вид моей сети:
                  Скрытый текст
                  user posted image

                  Далее то как мне нужно перенаправить порт так, но это не работает!
                  Скрытый текст
                  user posted image

                  Пробую следующий вариант и он не работает:
                  Скрытый текст
                  user posted image

                  И последний вариант который работает:
                  Скрытый текст
                  user posted image

                  Помогите мне хотя бы сделать вариант номер 2
                  Скрытый текст
                  user posted image
                    Не в регистре ли проблема? А так, больше в глаза ничего не бросается.
                    Проблема, чую я, в этом конфиге, если все остальное работает.

                    Цитата cpp_and_asm @
                    config zone
                        option input 'ACCEPT'
                        option forward 'ACCEPT'
                        option output 'ACCEPT'
                        option name 'internet'
                        option masq '1'
                        option network 'WAN'

                    Цитата cpp_and_asm @
                    config redirect
                        option target 'DNAT'
                        option src 'wan'
                        option dest 'lan'
                        option proto 'tcp udp'
                        option src_dport '1313'
                        option dest_ip '192.168.0.119'
                        option dest_port '1313'
                        option name '1313'


                    И еще, в option src указывается значение из option name, если вчитаться в конфиг, а тут указано из option network.
                    Это просто предположение, но стоит проверить, указать internet вместо wan.
                    Ну т.е.
                    Скрытый текст
                    Цитата cpp_and_asm @
                    config redirect
                        option target 'DNAT'
                        option src 'internet'
                        option dest 'lan'
                        option proto 'tcp udp'
                        option src_dport '1313'
                        option dest_ip '192.168.0.119'
                        option dest_port '1313'
                        option name '1313'
                      Проблему решил.
                      Вся эта схема была из за того что тплинк 7210 не поддерживал не бридж, не forwarding. И оказывается, у него через раз работал проброс портов.
                      Тоесть он мог один раз пробросить порт, а потом до перезагрузки не пробрасывать!
                      Странно но это факт, заменил его на mikrotik в режиме бриджа и проблема решена.
                      Весь косяк был в 7210. А я грешил на openwrt. Впредь буду лучше проверять устройства и никогда не пользоваться прошивками от tp-link
                        Цитата cpp_and_asm @
                        и никогда не пользоваться прошивками от tp-link

                        может быть в openwrt проблема?
                        1 пользователей читают эту тему (1 гостей и 0 скрытых пользователей)
                        0 пользователей:


                        Рейтинг@Mail.ru
                        [ Script execution time: 0,0430 ]   [ 14 queries used ]   [ Generated: 13.05.24, 19:40 GMT ]