21 Kwietnia 2025 16:00:14
Nawigacja
· Strona Główna
· Forum

· Tomato by Shibby
· FreshTomato


Wątki na forum
Najnowsze dyskusje
· Netia IPv6
· [S] Ubiquity Edgerou...
· Multiroom N z wykorz...
· [MOD] FreshTomato-AR...
· Nowe routery: UX, UC...
· asus rt-ax86u pro z ...
· Zmiana OpenVPN na wi...
· [S]UBIQUITI EdgeRout...
· Zaawansowana konfigu...
· ByPass VPN dla wybra...
· [MOD] FreshTomato-MI...
· Komputer Serwer
· Ciągle rozłączani...
· Wersje Freshtomato d...
· FreshTomato- WAN inn...
· Pojemniki na FreshTo...
· [K] Obudowę Kompute...
· Asus RT-AC3200 overc...
· Asus RT-AX86U PRo re...
· Usuwanie plików z d...
Najpopularniejsze obecnie wątki
· Netia IPv6 [3]
· [S] Ubiquity Edge... [0]
Ankieta
Jaki procesor posiada twój router?

Broadcom MIPSEL
Broadcom MIPSEL
36% [152 głosów]

Broadcom ARM
Broadcom ARM
52% [219 głosów]

Atheros
Atheros
5% [22 głosów]

Marvell
Marvell
1% [4 głosów]

Ralink
Ralink
1% [3 głosów]

Intel/AMD/VIA
Intel/AMD/VIA
1% [5 głosów]

Żaden z powyższych
Żaden z powyższych
4% [15 głosów]

Ogółem głosów: 420
Musisz zalogować się, aby móc zagłosować.
Rozpoczęto: 02/02/2015 09:38
Twoje IP
3.17.4.37
Zobacz wątek
OpenLinksys » :: OPROGRAMOWANIE :: » OpenWrt - firmware
 Drukuj wątek
iptables
qwerty01
Mam problem z ustawieniem ftp na hasło (brak miejsca na config) więc postanowiłem przekierować pakiety za pomocą iptables (aby określony ip z zewnątrz mógł się połączyć). Czytam pomoc iptables, ale coś zrobiłem źle

Cytat

iptables -A -s ADRES:IP --destination-port 21 --j 192.168.1.1

Jak powinna brzmieć poprawna komenda?
TP-Link WR1043ND + 64 MB ram mod + dysk 160 GB.
www.speedtest.net/result/1920298676.png
 
shibby
a gdzie masz lancuch? INPUT, FORWARD...
gdzie podziales akcje? po -j.

ogolnie powinnp wystarczyc cos takiego

Cytat

iptables -A INPUT -s ADRES_IP -p tcp --dport 21 -j ACCEPT


czyli akceptujesz polaczenia z danego ip na port 21 routera. Polaczenia z pozostalych ip sa zablokowane.
Router: Unifi Cloud Gateway Max
Switch: Unifi USW-Lite-16-PoE
Switch: Unifi USW-Flex-Mini - szt. 2
Wi-Fi: Unifi U6-Lite - szt. 2
Proxmox VE: i5-13400T, 64GB RAM, 2x 512GB NVMe, 3x 2TB SSD
VM #1: Synology SA6400
VM #2: Debian, WWW
VM #3: Home Assistant OS
 
qwerty01

Cytat

shibby napisał/a:
a gdzie masz lancuch? INPUT, FORWARD...
gdzie podziales akcje? po -j.

ogolnie powinnp wystarczyc cos takiego

Cytat

iptables -A INPUT -s ADRES_IP -p tcp --dport 21 -j ACCEPT


czyli akceptujesz polaczenia z danego ip na port 21 routera. Polaczenia z pozostalych ip sa zablokowane.

Wielki mistrzu. Jednak mimo dodania twojej komendy nie działa (przepuszcza wszystko). Jest związany z dodaniem reguły w firewall?

Cytat

config 'rule'
option '_name' 'ftp'
option 'src' 'wan'
option 'target' 'ACCEPT'
option 'proto' 'tcp'
option 'dest_port' '21'

Nawet na liście reguł go nie ma (albo nie widzę):

Cytat

root@OpenWrt:~# iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state 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 DROP)
target prot opt source destination
zone_wan_MSSFIX all -- anywhere anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED
forwarding_rule all -- anywhere anywhere
forward all -- anywhere anywhere
reject all -- anywhere anywhere

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
ACCEPT all -- anywhere anywhere state 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_wan_forward all -- anywhere anywhere

Chain forwarding_3g (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

Chain forwarding_wan (1 references)
target prot opt source destination

Chain input (1 references)
target prot opt source destination
zone_lan all -- anywhere anywhere
zone_wan all -- anywhere anywhere

Chain input_3g (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_wan (1 references)
target prot opt source destination

Chain output (1 references)
target prot opt source destination
zone_lan_ACCEPT all -- anywhere anywhere
zone_wan_ACCEPT all -- anywhere anywhere
zone_3g_ACCEPT all -- anywhere anywhere

Chain output_rule (1 references)
target prot opt source destination

Chain reject (5 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 (0 references)
target prot opt source destination
input_3g all -- anywhere anywhere
zone_3g_REJECT all -- anywhere anywhere

Chain zone_3g_ACCEPT (2 references)
target prot opt source destination

Chain zone_3g_DROP (0 references)
target prot opt source destination

Chain zone_3g_MSSFIX (0 references)
target prot opt source destination

Chain zone_3g_REJECT (2 references)
target prot opt source destination

Chain zone_3g_forward (0 references)
target prot opt source destination
forwarding_3g all -- anywhere anywhere
zone_3g_REJECT 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 (2 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_MSSFIX (0 references)
target prot opt source destination
TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU

Chain zone_lan_REJECT (1 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_wan_ACCEPT all -- anywhere anywhere
zone_3g_ACCEPT all -- anywhere anywhere
forwarding_lan all -- anywhere anywhere
zone_lan_REJECT all -- anywhere anywhere

Chain zone_wan (1 references)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp dpt:68
ACCEPT icmp -- anywhere anywhere icmp echo-request
ACCEPT tcp -- anywhere anywhere tcp dpt:51413
ACCEPT tcp -- anywhere anywhere tcp dpt:9091
ACCEPT tcp -- anywhere anywhere tcp dpt:21
input_wan all -- anywhere anywhere
zone_wan_REJECT all -- anywhere anywhere

Chain zone_wan_ACCEPT (2 references)
target prot opt source destination
ACCEPT all -- anywhere anywhere
ACCEPT all -- anywhere anywhere

Chain zone_wan_DROP (0 references)
target prot opt source destination
DROP all -- anywhere anywhere
DROP all -- anywhere anywhere

Chain zone_wan_MSSFIX (1 references)
target prot opt source destination
TCPMSS tcp -- anywhere anywhere tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU

Chain zone_wan_REJECT (2 references)
target prot opt source destination
reject all -- anywhere anywhere
reject all -- anywhere anywhere

Chain zone_wan_forward (1 references)
target prot opt source destination
ACCEPT udp -- anywhere laptop.lan udp dpt:6565
ACCEPT tcp -- anywhere laptop.lan tcp dpt:6565
ACCEPT udp -- anywhere 192.168.1.100 udp dpt:6464
ACCEPT tcp -- anywhere 192.168.1.100 tcp dpt:6464
ACCEPT udp -- anywhere 192.168.1.100 udp dpts:27950:27970
ACCEPT tcp -- anywhere 192.168.1.100 tcp dpts:27950:27970
ACCEPT udp -- anywhere laptop.lan udp dpt:3838
ACCEPT tcp -- anywhere laptop.lan tcp dpt:3838
ACCEPT udp -- anywhere 192.168.1.100 udp dpt:1111
ACCEPT tcp -- anywhere 192.168.1.100 tcp dpt:1111
ACCEPT udp -- anywhere 192.168.1.100 udp dpt:3737
ACCEPT tcp -- anywhere 192.168.1.100 tcp dpt:3737
forwarding_wan all -- anywhere anywhere
zone_wan_REJECT all -- anywhere anywhere

Edytowany przez qwerty01 dnia 21-08-2010 15:47
TP-Link WR1043ND + 64 MB ram mod + dysk 160 GB.
www.speedtest.net/result/1920298676.png
 
shibby
tak to wina tego wpipsu bo nim wpuszczasz wszystko na port 21.

zmien ten config na

Cytat

config 'rule'
option '_name' 'ftp'
option 'src' 'wan'
option 'target' 'ACCEPT'
option 'proto' 'tcp'
option 'src_ip' 'wpuszczane_ip'
option 'dest_port' '21'


w ten sposb otworzysz port tylko dla jednego ip.
Router: Unifi Cloud Gateway Max
Switch: Unifi USW-Lite-16-PoE
Switch: Unifi USW-Flex-Mini - szt. 2
Wi-Fi: Unifi U6-Lite - szt. 2
Proxmox VE: i5-13400T, 64GB RAM, 2x 512GB NVMe, 3x 2TB SSD
VM #1: Synology SA6400
VM #2: Debian, WWW
VM #3: Home Assistant OS
 
qwerty01

Cytat

shibby napisał/a:
tak to wina tego wpipsu bo nim wpuszczasz wszystko na port 21.

zmien ten config na

Cytat

config 'rule'
option '_name' 'ftp'
option 'src' 'wan'
option 'target' 'ACCEPT'
option 'proto' 'tcp'
option 'src_ip' 'wpuszczane_ip'
option 'dest_port' '21'


w ten sposb otworzysz port tylko dla jednego ip.

Zdaje się, że działa - w iptables -L wygląda ok. Jakbym chciał odblokować dodatkowe IP to mam dać
option 'src_ip' 'wpuszczane_ip1'
option 'src_ip' 'wpuszczane_ip2'
czy powtarzać całą regułkę?
TP-Link WR1043ND + 64 MB ram mod + dysk 160 GB.
www.speedtest.net/result/1920298676.png
 
shibby
powtarzac cala regulke.
Router: Unifi Cloud Gateway Max
Switch: Unifi USW-Lite-16-PoE
Switch: Unifi USW-Flex-Mini - szt. 2
Wi-Fi: Unifi U6-Lite - szt. 2
Proxmox VE: i5-13400T, 64GB RAM, 2x 512GB NVMe, 3x 2TB SSD
VM #1: Synology SA6400
VM #2: Debian, WWW
VM #3: Home Assistant OS
 
Przejdź do forum
Zaloguj
Wprowadź adres e-mail lub nazwę użytkownika

Hasło



Nie masz jeszcze konta? Zarejestruj się.

Zapomniałeś/aś hasła?
Aktualnie online
· Gości online: 67

· Użytkowników online: 0

· Łącznie użytkowników: 24,126
· Najnowszy użytkownik: goldi111
Czat
Musisz się zalogować, aby opublikować wiadomość.

servee
24-01-2025 18:18
Światłowód + mediakonwenter. Ekranowana skrętka nie jest wymagana, taką sytuację już zastałem. Zamierzam ją wymienić na zwykłą. Da to coś?

shibby
17-01-2025 07:45
a ta skrętka ekranowana o której piszesz to jakiś wkopany przewód do bramy/furtki/kamer
y zewn? Jak tak to jego też przez zabezpieczenie podepnij.

shibby
17-01-2025 07:43
no to pora zabezpieczyć kable LAN zabezpieczeniami przeciwprzepięciow
ymi - tanio nie będzie. Jak przychodzi ci internet? Skrętką czy światłem? Jak skrętką to zacząłbym od tego.

servee
12-01-2025 12:52
Ponownie padły mi wszystkie porty sieciowe w routerze - to już 3-ci w 6 m-cy. Podejrzany to ekranowana, nieuziemiona skrętka - 12mb. Czy jest to możliwe?

dawidt
21-12-2024 01:09
siema Grin

Maniek91PL
06-11-2024 22:37
dzięki !Grin

maxikaaz
29-10-2024 14:27
@Maniek91PL - Administration=> Admin Access, i tam masz "Allow Wireless Access" do zaznaczenia

Maniek91PL
26-10-2024 22:07
siemka! ktoś przypomni co się ustawiało jeśli nie mogę wejść od strony wifi do tomato? od lan działa

overflow2
04-10-2024 17:34
Kupowałem Asusy n10u albo n12d1 ale nie widzę ich, chyba już nie produkują, Chodzi o coś nowego i taniego. Transfery niewielkie.

maxikaaz
04-10-2024 09:38
@overflow2 patrząc po dostępności funkcji w nowych kompilacjach, to chyba nawet WRT54G/GL jeszcze ma OpenVPN, albo jakiś odpowiednik... zależy, na jakie transfery liczysz.

114,509,953 unikalnych wizyt