1

Temat: Otwieranie portów - nie działa

Mój problem:

- zainstalowałem Transmission
- ściągnałem jakiś torrent - wszystko ok
- niestety tracker mnie nie widzi więc odblokowałem port wg instrukcji

https://forum.openwrt.org/viewtopic.php?pid=122983

Mój firewall wygląda jak poniżej. Niestety wydaje mi się że port jest zamknięty. Dlaczego tak mi się wydaje?
- po kliknięciu w Testuj Port w Trasmission Remote GUI (po wprowadzeniu portu 51413 otrzymuje komunikat: Port połączeń przychodzących jest zablokowany
- próbowałem przeprowadzić taki sam test w uTorrent (na komputerze lokalnym) - także otrzymuje info że port jest zamknięty. Co robię źle?

config 'defaults'
    option 'syn_flood' '1'
    option 'input' 'ACCEPT'
    option 'output' 'ACCEPT'
    option 'forward' 'REJECT'

config 'zone'
    option 'name' 'lan'
    option 'network' 'lan'
    option 'input' 'ACCEPT'
    option 'output' 'ACCEPT'
    option 'forward' 'REJECT'

config 'zone'
    option 'network' 'wan'
    option 'name' 'wan'
    option 'input' 'REJECT'
    option 'output' 'ACCEPT'
    option 'forward' 'REJECT'
    option 'masq' '1'
    option 'mtu_fix' '1'

config 'forwarding'
    option 'src' 'lan'
    option 'dest' 'wan'

config 'rule'
    option 'src' 'wan'
    option 'proto' 'udp'
    option 'dest_port' '68'
    option 'target' 'ACCEPT'
    option 'family' 'ipv4'

config 'rule'
    option 'src' 'wan'
    option 'proto' 'icmp'
    option 'icmp_type' 'echo-request'
    option 'target' 'ACCEPT'

config 'include'
    option 'path' '/etc/firewall.user'

config 'include'
    option 'path' '/usr/lib/gargoyle_firewall_util/gargoyle_additions.firewall'

config 'rule'
    option 'src' 'wan'
    option 'target' 'ACCEPT'
    option 'proto' 'tcp'
    option 'dest_port' '51413'
    
config 'rule'
    option 'src' 'wan'
    option 'target' 'ACCEPT'
    option 'proto' 'udp'
    option 'dest_port' '51413'

2

Odp: Otwieranie portów - nie działa

iptables -v -L pokaż.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: Otwieranie portów - nie działa

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
  539 79253 bw_ingress  all  --  eth0.2 any     anywhere             anywhere            
 6603  993K ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED 
   23  1653 ACCEPT     all  --  lo     any     anywhere             anywhere            
  277 13296 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN 
  540 34791 input_rule  all  --  any    any     anywhere             anywhere            
  540 34791 input      all  --  any    any     anywhere             anywhere            

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 8198 4550K bw_ingress  all  --  eth0.2 any     anywhere             anywhere            
 8198 4550K ingress_restrictions  all  --  eth0.2 any     anywhere             anywhere            
10638 1585K egress_restrictions  all  --  any    eth0.2  anywhere             anywhere            
18836 6135K zone_wan_MSSFIX  all  --  any    any     anywhere             anywhere            
16153 5909K ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED 
 2683  226K forwarding_rule  all  --  any    any     anywhere             anywhere            
 2683  226K forward    all  --  any    any     anywhere             anywhere            
    0     0 reject     all  --  any    any     anywhere             anywhere            

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination         
 4497 2985K ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED 
   23  1653 ACCEPT     all  --  any    lo      anywhere             anywhere            
  567 51153 output_rule  all  --  any    any     anywhere             anywhere            
  567 51153 output     all  --  any    any     anywhere             anywhere            

Chain bw_ingress (2 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total1-download-2-449 --type combined --current_bandwidth 0 --reset_interval 2 --reset_time 2 --intervals_to_save 449 
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist1-download-minute-15 --type individual_local --subnet 192.168.1.0/24 --reset_interval minute --intervals_to_save 15 
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total2-download-minute-359 --type combined --current_bandwidth 2320 --reset_interval minute --intervals_to_save 359 
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist2-download-900-24 --type individual_local --subnet 192.168.1.0/24 --reset_interval 900 --reset_time 900 --intervals_to_save 24 
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total3-download-180-479 --type combined --current_bandwidth 2320 --reset_interval 180 --reset_time 180 --intervals_to_save 479 
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist3-download-hour-24 --type individual_local --subnet 192.168.1.0/24 --reset_interval hour --intervals_to_save 24 
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total4-download-7200-359 --type combined --current_bandwidth 4958666 --reset_interval 7200 --reset_time 7200 --intervals_to_save 359 
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist4-download-day-31 --type individual_local --subnet 192.168.1.0/24 --reset_interval day --intervals_to_save 31 
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id total5-download-day-365 --type combined --current_bandwidth 5590298 --reset_interval day --intervals_to_save 365 
    0     0            all  --  any    any     anywhere             anywhere            bandwidth --id bdist5-download-month-12 --type individual_local --subnet 192.168.1.0/24 --reset_interval month --intervals_to_save 12 

Chain egress_restrictions (1 references)
 pkts bytes target     prot opt in     out     source               destination         
10638 1585K egress_whitelist  all  --  any    any     anywhere             anywhere            

Chain egress_whitelist (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 2683  226K zone_lan_forward  all  --  br-lan any     anywhere             anywhere            
    0     0 zone_wan_forward  all  --  eth0.2 any     anywhere             anywhere            

Chain forwarding_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain forwarding_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 2683  226K nat_reflection_fwd  all  --  any    any     anywhere             anywhere            

Chain forwarding_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain ingress_restrictions (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 8198 4550K ingress_whitelist  all  --  any    any     anywhere             anywhere            

Chain ingress_whitelist (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  479 28906 zone_lan   all  --  br-lan any     anywhere             anywhere            
   61  5885 zone_wan   all  --  eth0.2 any     anywhere             anywhere            

Chain input_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain input_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain nat_reflection_fwd (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain output (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  567 51153 zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere            
  551 47891 zone_wan_ACCEPT  all  --  any    any     anywhere             anywhere            

Chain output_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain pf_loopback_B (1 references)
 pkts bytes target     prot opt in     out     source               destination         

Chain reject (5 references)
 pkts bytes target     prot opt in     out     source               destination         
    1    40 REJECT     tcp  --  any    any     anywhere             anywhere            reject-with tcp-reset 
   55  4919 REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable 

Chain syn_flood (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  271 13008 RETURN     tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50 
    6   288 DROP       all  --  any    any     anywhere             anywhere            

Chain zone_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  479 28906 input_lan  all  --  any    any     anywhere             anywhere            
  479 28906 zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere            

Chain zone_lan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination         
   16  3262 ACCEPT     all  --  any    br-lan  anywhere             anywhere            
  479 28906 ACCEPT     all  --  br-lan any     anywhere             anywhere            

Chain zone_lan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  any    br-lan  anywhere             anywhere            
    0     0 DROP       all  --  br-lan any     anywhere             anywhere            

Chain zone_lan_MSSFIX (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 TCPMSS     tcp  --  any    br-lan  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU 

Chain zone_lan_REJECT (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 reject     all  --  any    br-lan  anywhere             anywhere            
    0     0 reject     all  --  br-lan any     anywhere             anywhere            

Chain zone_lan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
 2683  226K pf_loopback_B  all  --  any    any     anywhere             anywhere            
    0     0 ACCEPT     all  --  br-lan br-lan  anywhere             anywhere            
 2683  226K zone_wan_ACCEPT  all  --  any    any     anywhere             anywhere            
    0     0 forwarding_lan  all  --  any    any     anywhere             anywhere            
    0     0 zone_lan_REJECT  all  --  any    any     anywhere             anywhere            

Chain zone_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere            icmp echo-request 
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:51413 
    5   926 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:51413 
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:bootpc 
   56  4959 input_wan  all  --  any    any     anywhere             anywhere            
   56  4959 zone_wan_REJECT  all  --  any    any     anywhere             anywhere            

Chain zone_wan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination         
 3234  274K ACCEPT     all  --  any    eth0.2  anywhere             anywhere            
    0     0 ACCEPT     all  --  eth0.2 any     anywhere             anywhere            

Chain zone_wan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 DROP       all  --  any    eth0.2  anywhere             anywhere            
    0     0 DROP       all  --  eth0.2 any     anywhere             anywhere            

Chain zone_wan_MSSFIX (1 references)
 pkts bytes target     prot opt in     out     source               destination         
  688 33228 TCPMSS     tcp  --  any    eth0.2  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU 

Chain zone_wan_REJECT (2 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 reject     all  --  any    eth0.2  anywhere             anywhere            
   56  4959 reject     all  --  eth0.2 any     anywhere             anywhere            

Chain zone_wan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination         
    0     0 forwarding_wan  all  --  any    any     anywhere             anywhere            
    0     0 zone_wan_REJECT  all  --  any    any     anywhere             anywhere             

4

Odp: Otwieranie portów - nie działa

Wszystko gra. Porty są otwarte, na liczniki też się coś złapało.  Z tego punktu widzenia masz ok.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5

Odp: Otwieranie portów - nie działa

Hmm to nie wiem.

A czy może mieć znaczenie że TP-Link jest podłączony do drugiego routera (który jest zintegrowany z modemem).

Na tamtym modemie mam co prawda ustawiony DMZ na TP-Linka, ale może to ma jakieś znaczenie?

6

Odp: Otwieranie portów - nie działa

Tak, może mieć znaczenie. Zrób przekierowanie z tamtego z tego protu na port tplinka.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

7

Odp: Otwieranie portów - nie działa

Zrobiłem przekierowanie - test portów działa.

Dzięki

8 (edytowany przez mlb 2011-09-02 07:04:36)

Odp: Otwieranie portów - nie działa

Podepnę się do tematu - bardzo podobny problem. Mam TP-Link TL-MR3420 oraz podpięty na USB modem 3G. Wgrałem wersję 1.4.1 (r28127), by obsy.
Przekierowanie portów nie działa (chciałem mieć dostęp do serwerka za routerem poprzez VNC i RDP). Nie jest to kwestia operatora, mam wykupioną usługę adresu publicznego. Do samego routera mogę dostać się z zewnątrz, ale już przekierowanie portów nie działa, muszę ratować się ssh - a nie jest to zbyt wygodne rozwiązanie.

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
   97 11224 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED
   58  4180 ACCEPT     all  --  lo     any     anywhere             anywhere
    0     0 syn_flood  tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN
    0     0 input_rule  all  --  any    any     anywhere             anywhere
    0     0 input      all  --  any    any     anywhere             anywhere

Chain FORWARD (policy DROP 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ingress_restrictions  all  --  3g-wan any     anywhere             anywhere
    0     0 egress_restrictions  all  --  any    3g-wan  anywhere             anywhere
    0     0 zone_wan_MSSFIX  all  --  any    any     anywhere             anywhere
    0     0 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED
    0     0 forwarding_rule  all  --  any    any     anywhere             anywhere
    0     0 forward    all  --  any    any     anywhere             anywhere
    0     0 reject     all  --  any    any     anywhere             anywhere

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination
   73 16768 ACCEPT     all  --  any    any     anywhere             anywhere            state RELATED,ESTABLISHED
   58  4180 ACCEPT     all  --  any    lo      anywhere             anywhere
   27  2011 output_rule  all  --  any    any     anywhere             anywhere
   27  2011 output     all  --  any    any     anywhere             anywhere

Chain egress_restrictions (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 egress_whitelist  all  --  any    any     anywhere             anywhere

Chain egress_whitelist (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 zone_lan_forward  all  --  br-lan any     anywhere             anywhere
    0     0 zone_wan_forward  all  --  3g-wan any     anywhere             anywhere

Chain forwarding_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain forwarding_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 nat_reflection_fwd  all  --  any    any     anywhere             anywhere

Chain forwarding_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain ingress_restrictions (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ingress_whitelist  all  --  any    any     anywhere             anywhere

Chain ingress_whitelist (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 zone_lan   all  --  br-lan any     anywhere             anywhere
    0     0 zone_wan   all  --  3g-wan any     anywhere             anywhere

Chain input_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain input_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:https connmark match 0x80/0x80
    0     0            tcp  --  any    any     anywhere             anywhere            tcp dpt:ssh recent: SET name: SSH_CHECK side: source
    0     0 DROP       all  --  any    any     anywhere             anywhere            recent: UPDATE seconds: 300 hit_count: 6 name: SSH_CHECK side: source
    0     0 ACCEPT     tcp  --  any    any     anywhere             anywhere            tcp dpt:ssh

Chain nat_reflection_fwd (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  any    any     10.162.0.0/24        10.162.0.30         tcp dpt:5900
    0     0 ACCEPT     tcp  --  any    any     10.162.0.0/24        10.162.0.30         tcp dpt:3389

Chain output (1 references)
 pkts bytes target     prot opt in     out     source               destination
   27  2011 zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere
   27  2011 zone_wan_ACCEPT  all  --  any    any     anywhere             anywhere

Chain output_rule (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain pf_loopback_B (1 references)
 pkts bytes target     prot opt in     out     source               destination

Chain reject (5 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 REJECT     tcp  --  any    any     anywhere             anywhere            reject-with tcp-reset
    0     0 REJECT     all  --  any    any     anywhere             anywhere            reject-with icmp-port-unreachable

Chain syn_flood (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 RETURN     tcp  --  any    any     anywhere             anywhere            tcp flags:FIN,SYN,RST,ACK/SYN limit: avg 25/sec burst 50
    0     0 DROP       all  --  any    any     anywhere             anywhere

Chain zone_lan (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 input_lan  all  --  any    any     anywhere             anywhere
    0     0 zone_lan_ACCEPT  all  --  any    any     anywhere             anywhere

Chain zone_lan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     all  --  any    br-lan  anywhere             anywhere
    0     0 ACCEPT     all  --  br-lan any     anywhere             anywhere

Chain zone_lan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  any    br-lan  anywhere             anywhere
    0     0 DROP       all  --  br-lan any     anywhere             anywhere

Chain zone_lan_MSSFIX (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 TCPMSS     tcp  --  any    br-lan  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU

Chain zone_lan_REJECT (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 reject     all  --  any    br-lan  anywhere             anywhere
    0     0 reject     all  --  br-lan any     anywhere             anywhere

Chain zone_lan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 pf_loopback_B  all  --  any    any     anywhere             anywhere
    0     0 ACCEPT     all  --  br-lan br-lan  anywhere             anywhere
    0     0 zone_wan_ACCEPT  all  --  any    any     anywhere             anywhere
    0     0 forwarding_lan  all  --  any    any     anywhere             anywhere
    0     0 zone_lan_REJECT  all  --  any    any     anywhere             anywhere

Chain zone_wan (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     udp  --  any    any     anywhere             anywhere            udp dpt:bootpc
    0     0 ACCEPT     icmp --  any    any     anywhere             anywhere            icmp echo-request
    0     0 input_wan  all  --  any    any     anywhere             anywhere
    0     0 zone_wan_REJECT  all  --  any    any     anywhere             anywhere

Chain zone_wan_ACCEPT (2 references)
 pkts bytes target     prot opt in     out     source               destination
   27  2011 ACCEPT     all  --  any    3g-wan  anywhere             anywhere
    0     0 ACCEPT     all  --  3g-wan any     anywhere             anywhere

Chain zone_wan_DROP (0 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 DROP       all  --  any    3g-wan  anywhere             anywhere
    0     0 DROP       all  --  3g-wan any     anywhere             anywhere

Chain zone_wan_MSSFIX (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 TCPMSS     tcp  --  any    3g-wan  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU

Chain zone_wan_REJECT (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 reject     all  --  any    3g-wan  anywhere             anywhere
    0     0 reject     all  --  3g-wan any     anywhere             anywhere

Chain zone_wan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 ACCEPT     tcp  --  any    any     anywhere             10.162.0.30         tcp dpt:5900
    0     0 ACCEPT     tcp  --  any    any     anywhere             10.162.0.30         tcp dpt:3389
    0     0 forwarding_wan  all  --  any    any     anywhere             anywhere
    0     0 zone_wan_REJECT  all  --  any    any     anywhere             anywhere
kilka urządzeń z Mikrotik i OpenWRT

9

Odp: Otwieranie portów - nie działa

Już lepiej /etc/config/firewall pokaż.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

10

Odp: Otwieranie portów - nie działa

Cezary napisał/a:

Już lepiej /etc/config/firewall pokaż.

Oto on:

config 'defaults'
        option 'syn_flood' '1'
        option 'input' 'ACCEPT'
        option 'output' 'ACCEPT'
        option 'forward' 'REJECT'

config 'zone'
        option 'name' 'lan'
        option 'network' 'lan'
        option 'input' 'ACCEPT'
        option 'output' 'ACCEPT'
        option 'forward' 'REJECT'

config 'zone'
        option 'name' 'wan'
        option 'network' 'wan'
        option 'input' 'REJECT'
        option 'output' 'ACCEPT'
        option 'forward' 'REJECT'
        option 'masq' '1'
        option 'mtu_fix' '1'

config 'forwarding'
        option 'src' 'lan'
        option 'dest' 'wan'

config 'rule'
        option 'src' 'wan'
        option 'proto' 'udp'
        option 'dest_port' '68'
        option 'target' 'ACCEPT'
        option 'family' 'ipv4'

config 'rule'
        option 'src' 'wan'
        option 'proto' 'icmp'
        option 'icmp_type' 'echo-request'
        option 'family' 'ipv4'
        option 'target' 'ACCEPT'

config 'rule'
        option 'src' 'wan'
        option 'dest' '*'
        option 'proto' 'icmp'
        list 'icmp_type' 'echo-request'
        list 'icmp_type' 'destination-unreachable'
        list 'icmp_type' 'packet-too-big'
        list 'icmp_type' 'time-exceeded'
        list 'icmp_type' 'bad-header'
        list 'icmp_type' 'unknown-header-type'
        option 'limit' '1000/sec'
        option 'family' 'ipv6'
        option 'target' 'ACCEPT'

config 'include'
        option 'path' '/etc/firewall.user'

config 'include'
        option 'path' '/usr/lib/gargoyle_firewall_util/gargoyle_additions.firewall'

config 'remote_accept' 'ra_443_8001'
        option 'local_port' '443'
        option 'remote_port' '8001'
        option 'proto' 'tcp'
        option 'zone' 'wan'

config 'remote_accept' 'ra_22_22'
        option 'local_port' '22'
        option 'remote_port' '22'
        option 'proto' 'tcp'
        option 'zone' 'wan'

config 'redirect' 'redirect_enabled_number_0'
        option 'name' 'VNC'
        option 'src' 'wan'
        option 'dest' 'lan'
        option 'proto' 'tcp'
        option 'src_dport' '5900'
        option 'dest_ip' '10.162.0.30'
        option 'dest_port' '5900'

config 'redirect' 'redirect_enabled_number_1'
        option 'name' 'RDP'
        option 'src' 'wan'
        option 'dest' 'lan'
        option 'proto' 'tcp'
        option 'src_dport' '3389'
        option 'dest_ip' '10.162.0.30'
        option 'dest_port' '3389'

Nie kombinowałem z ręczną konfiguracją, ustawiłem tylko porty przez interfejs WWW...

kilka urządzeń z Mikrotik i OpenWRT

11

Odp: Otwieranie portów - nie działa

Jakie masz IP na lanie? 10.162.0.x?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

12

Odp: Otwieranie portów - nie działa

Cezary napisał/a:

Jakie masz IP na lanie? 10.162.0.x?

Tak, 10.162.0.x

Adres IP LAN:10.162.0.3
Maska podsieci LAN:255.255.255.0 

Dodatkowo do LAN mam podpięte 2 urządzenia 192.168.0.253 i 192.168.0.254, ale one komunikują się tylko między sobą i nie powinny mieć dostępu do Internetu i na odwrót.

kilka urządzeń z Mikrotik i OpenWRT

13

Odp: Otwieranie portów - nie działa

Dodam tylko że na innym routerze (RT-N16) przekierowanie do tej podsieci działa bez problemów, tyle że tamten działa na dd-wrt. Czyżby jakiś problem z jądrem?

kilka urządzeń z Mikrotik i OpenWRT

14

Odp: Otwieranie portów - nie działa

Nie powinno. Przekierowanie portów działa i nie odczuwam problemów z tym związanych, więc problem musi być jakiś szczególny.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

15 (edytowany przez mlb 2011-09-03 20:23:28)

Odp: Otwieranie portów - nie działa

No niestety... przywróciłem ustawienia domyślne, tym razem zrobiłem sieć wewnętrzną 192.168.0.0/255.255.255.0 i dalej jest to samo. Być może jest jakiś bug w sytuacji gdy podłączony jest modem 3G.

Być może nie jest to kwestia samego iptables, przynajmniej licznik zlicza połączenia na port 5900:

Chain zone_wan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
   15   852 ACCEPT     tcp  --  any    any     anywhere             192.168.0.253       tcp dpt:5900
    0     0 forwarding_wan  all  --  any    any     anywhere             anywhere
    0     0 zone_wan_REJECT  all  --  any    any     anywhere             anywhere
kilka urządzeń z Mikrotik i OpenWRT

16

Odp: Otwieranie portów - nie działa

Więc pakiety się łapią i są przekazywane...

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

17

Odp: Otwieranie portów - nie działa

No właśnie. Ale gdzieś giną i nie bardzo to rozumiem.
Gdy podłączę się do routera przez ssh, komenda "telnet 192.168.0.253 5900" działa bez problemu, ale już z samego WAN - nie, jest timeout. Z zewnątrz mogę podłączyć się z sukcesem tylko do portu 22 i 8001 (na którym mam dostęp do panelu routera).

kilka urządzeń z Mikrotik i OpenWRT

18

Odp: Otwieranie portów - nie działa

Popatrz na to:

Chain zone_wan_REJECT (2 references)
 pkts bytes target     prot opt in     out     source               destination
    0     0 reject     all  --  any    3g-wan  anywhere             anywhere
   84  4491 reject     all  --  3g-wan any     anywhere             anywhere

Chain zone_wan_forward (1 references)
 pkts bytes target     prot opt in     out     source               destination
   24  1392 ACCEPT     tcp  --  any    any     anywhere             192.168.0.253       tcp dpt:5900
    0     0 forwarding_wan  all  --  any    any     anywhere             anywhere
    0     0 zone_wan_REJECT  all  --  any    any     anywhere             anywhere

Skąd te 84 odrzucone pakiety w zone_wan_REJECT ? Czy przypadkiem zone_wan_forward  nie powinno być przed zone_wan_REJECT? Nie jestem w tej dziedzinie ekspertem, ale wydaje mi się to mocno podejrzane.

kilka urządzeń z Mikrotik i OpenWRT

19

Odp: Otwieranie portów - nie działa

Ale nie patrz na wynik z outputu tylko ja są te dwa łańcuchy zapisane w kolejności.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

20

Odp: Otwieranie portów - nie działa

Poszperałem trochę w sieci - zdaje się że ten problem istnieje od dawna: http://www.gargoyle-router.com/phpbb/vi … 6&t=85

Też próbuję przekierować do urządzenia o adresie IP wpisanym na stałe, a nie nadanym przez DHCP...

kilka urządzeń z Mikrotik i OpenWRT

21

Odp: Otwieranie portów - nie działa

Właśnie sprawdziłem to u siebie - przekierowanie do adresów nadanych przez dhcp działa prawidłowo. Więc ten bug wciąż nie został poprawiony...

kilka urządzeń z Mikrotik i OpenWRT