1

Temat: Przekierowanie portów - 2 routery

Witam,
Mam problem z przekierowaniem portów.
Otóż w mojej sieci posiadam 2 routery firmy TP-LINK.
Pierwszy z nich podłączony do sieci WAN (zewnętrzny adres IP) - z włączoną usługą DHCP. (Software Vargalex)
Drugi z nich jest podłączony za pośrednictwem portu LAN, z wyłączoną usługą DHCP. (Stock software)

Pierwszy ma adres wew. 192.168.1.1
Drugi ma adres wew: 192.168.1.2

Widzę wszystkie urządzenia w sieci, mogę wchodzić na dowolny router z każdego urządzenia.

Uruchomiłem usługę FTP na drugim routerze, port 21, natomiast na pierwszym routerze (WAN) przekierowałem porty w następujący sposób:
Match:
IPv4: TCP/UDP
From any host in wan
Via any router IP at port 21.

Forward to:
192.168.1.2 in lan.
Z każdego urządzenia wewnątrz sieci mogę wejść na FTP:
192.168.1.2

Test otwartych portów:

PORT STATE SERVICE
21/tcp filtered ftp
21/udp open|filtered ftp

Z wewnętrznych urządzeń mogę na FTP wejść (obojętnie czy po wewnętrznym adresie czy po zewnętrznym) natomiast z zewnątrz już nie wchodzę. FTP działa na protokole tcp a z tego co widze jest zamknięty, czego może być to wina?

2

Odp: Przekierowanie portów - 2 routery

Zapomnij o luci, diagnostyka w nim to czysty masochizm. Pokaż wynik polecenia

uci show firewall

Oprócz port 21 możesz mieć potrzebę przekierowania innych portów, zależy czy używasz passive czy active ftp. Ale to wyjdzie podczas połączenia, najpierw trzeba sprawić żebyś się w ogóle podłączył.

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

3 (edytowany przez mkf118 2017-12-04 16:38:51)

Odp: Przekierowanie portów - 2 routery

Cezary napisał/a:

Zapomnij o luci, diagnostyka w nim to czysty masochizm. Pokaż wynik polecenia
uci show firewall

firewall.@defaults[0]=defaults
firewall.@defaults[0].syn_flood=1
firewall.@defaults[0].input=ACCEPT
firewall.@defaults[0].output=ACCEPT
firewall.@defaults[0].forward=REJECT
firewall.@zone[0]=zone
firewall.@zone[0].name=lan
firewall.@zone[0].network=lan
firewall.@zone[0].input=ACCEPT
firewall.@zone[0].output=ACCEPT
firewall.@zone[0].forward=REJECT
firewall.@zone[1]=zone
firewall.@zone[1].name=wan
firewall.@zone[1].network=wan
firewall.@zone[1].input=DROP
firewall.@zone[1].output=ACCEPT
firewall.@zone[1].forward=REJECT
firewall.@zone[1].masq=1
firewall.@zone[1].mtu_fix=1
firewall.@forwarding[0]=forwarding
firewall.@forwarding[0].src=lan
firewall.@forwarding[0].dest=wan
firewall.@rule[0]=rule
firewall.@rule[0].src=wan
firewall.@rule[0].proto=udp
firewall.@rule[0].dest_port=68
firewall.@rule[0].target=ACCEPT
firewall.@rule[0].family=ipv4
firewall.@rule[1]=rule
firewall.@rule[1].src=wan
firewall.@rule[1].proto=icmp
firewall.@rule[1].icmp_type=echo-request
firewall.@rule[1].family=ipv4
firewall.@rule[1].target=ACCEPT
firewall.@rule[2]=rule
firewall.@rule[2].src=wan
firewall.@rule[2].proto=udp
firewall.@rule[2].src_ip=fe80::/10
firewall.@rule[2].src_port=547
firewall.@rule[2].dest_ip=fe80::/10
firewall.@rule[2].dest_port=546
firewall.@rule[2].family=ipv6
firewall.@rule[2].target=ACCEPT
firewall.@rule[3]=rule
firewall.@rule[3].src=wan
firewall.@rule[3].proto=icmp
firewall.@rule[3].icmp_type=echo-request destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type router-solicitation neighbour-solicitation router-advertisement neighbour-advertisement
firewall.@rule[3].limit=1000/sec
firewall.@rule[3].family=ipv6
firewall.@rule[3].target=ACCEPT
firewall.@rule[4]=rule
firewall.@rule[4].src=wan
firewall.@rule[4].dest=*
firewall.@rule[4].proto=icmp
firewall.@rule[4].icmp_type=echo-request destination-unreachable packet-too-big time-exceeded bad-header unknown-header-type
firewall.@rule[4].limit=1000/sec
firewall.@rule[4].family=ipv6
firewall.@rule[4].target=ACCEPT
firewall.@rule[5]=rule
firewall.@rule[5].name=Enforce-ULA-Border-Src
firewall.@rule[5].src=*
firewall.@rule[5].dest=wan
firewall.@rule[5].proto=all
firewall.@rule[5].src_ip=fc00::/7
firewall.@rule[5].family=ipv6
firewall.@rule[5].target=REJECT
firewall.@rule[6]=rule
firewall.@rule[6].name=Enforce-ULA-Border-Dest
firewall.@rule[6].src=*
firewall.@rule[6].dest=wan
firewall.@rule[6].proto=all
firewall.@rule[6].dest_ip=fc00::/7
firewall.@rule[6].family=ipv6
firewall.@rule[6].target=REJECT
firewall.@include[0]=include
firewall.@include[0].path=/etc/firewall.user
firewall.@rule[7]=rule
firewall.@rule[7].target=ACCEPT
firewall.@rule[7]._name=ssh_WAN
firewall.@rule[7].src=wan
firewall.@rule[7].proto=tcp
firewall.@rule[7].dest_ip=192.168.1.1
firewall.@rule[7].dest_port=22
firewall.@rule[8]=rule
firewall.@rule[8].target=ACCEPT
firewall.@rule[8]._name=ftp_WAN
firewall.@rule[8].src=wan
firewall.@rule[8].proto=tcp
firewall.@rule[8].dest_ip=192.168.1.1
firewall.@rule[8].dest_port=21
firewall.@rule[10]=rule
firewall.@rule[10].target=ACCEPT
firewall.@rule[10]._name=Luci_HTTPS
firewall.@rule[10].src=wan
firewall.@rule[10].proto=tcp
firewall.@rule[10].dest_port=443
firewall.@rule[11]=rule
firewall.@rule[11].src=lan
firewall.@rule[11].name=block_internet_access_IP
firewall.@rule[11].target=DROP
firewall.@rule[11].dest=wan
firewall.@rule[11].extra=-m time --weekdays Mon,Tue,Wed,Thu,Fri --timestart 10:00 --timestop 22:00
firewall.@rule[11].enabled=0
firewall.@rule[11].src_ip=94.254.172.1
firewall.@redirect[6]=redirect
firewall.@redirect[6].target=DNAT
firewall.@redirect[6].src=wan
firewall.@redirect[6].dest=lan
firewall.@redirect[6].proto=tcp
firewall.@redirect[6].src_dport=21
firewall.@redirect[6].dest_ip=192.168.1.2
firewall.@redirect[6].dest_port=21
firewall.@redirect[6].name=FTP2

4

Odp: Przekierowanie portów - 2 routery

firewall.@rule[8]=rule
firewall.@rule[8].target=ACCEPT
firewall.@rule[8]._name=ftp_WAN
firewall.@rule[8].src=wan
firewall.@rule[8].proto=tcp
firewall.@rule[8].dest_ip=192.168.1.1
firewall.@rule[8].dest_port=21

Tą regułę usuń , jest zbędna przy przekierowaniu.

Czy host 192.168.1.2 ma poprawnie ustawioną trasę domyślną na 192.168.1.1?

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

5 (edytowany przez mkf118 2017-12-04 17:18:24)

Odp: Przekierowanie portów - 2 routery

Reguła już jest disabled.

Natomiast trasę nie wiem czy mam dobrze ustawione:

https://thumb.ibb.co/iTJDHw/screen.jpg
https://thumb.ibb.co/ehkAxw/screen3.png
https://thumb.ibb.co/if65VG/screen2.png

6

Odp: Przekierowanie portów - 2 routery

Pewnie wcale nie masz, bo na oryginalnym sofcie nie wiem czy możesz ustawić na lanie gatewaya i dns. W system tool/diagnostic masz ping. Wykonaj ping do google.com i zobacz czy działa. Tak samo traceroute powinno pokazać wyjście przez 192.168.1.1

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

7 (edytowany przez mkf118 2017-12-04 17:37:49)

Odp: Przekierowanie portów - 2 routery

Żałuje, że kupiłem ten router, bo myślałem że będzie na niego OpenWRT. a na TP-LINK H5R niestety nie ma.
https://thumb.ibb.co/fANqxw/screen_4.png

8

Odp: Przekierowanie portów - 2 routery

Ja bym powiedział że właśnie to jest problemem. W lan jesteś w tej samej adresacji i wszystko działa, jak ruch przychodzi z internetu to on nie ma trasy domyślniej i nie wie gdzie odesłać pakiety.

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

9

Odp: Przekierowanie portów - 2 routery

A gdybym utworzył drugą podsieć, np. 192.168.0.* i użył WAN, lub zastosował jakiś WDS?

10

Odp: Przekierowanie portów - 2 routery

Możesz podłączyć go przez wan. Tylko zobacz czy ftp na nim też działa na tym wanie czy tylko w sieci lokalnej.

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

11

Odp: Przekierowanie portów - 2 routery

mkf118 napisał/a:

Reguła już jest disabled.

Natomiast trasę nie wiem czy mam dobrze ustawione:

https://thumb.ibb.co/iTJDHw/screen.jpg
https://thumb.ibb.co/ehkAxw/screen3.png
https://thumb.ibb.co/if65VG/screen2.png

Możesz go zostawić na LANie tak jak jest.
Na drugim obrazku masz dodawanie tras. Dodaj trasę do sieci 0.0.0.0/0 z bramą przez 192.168.1.1 i powinno zatrybić.
Może nie działać dns ale dla samego IP wystarczy.

Archer C7 v.2 + LEDE by Cezary http://beta.speedtest.net/pl/result/6621599402