Thread View: alt.pl.comp.os.linux.debian
4 messages
4 total messages
Started by Obserwator
Sun, 06 Apr 2008 11:06
Debian gateway - problem z przekierowaniem
Author: Obserwator
Date: Sun, 06 Apr 2008 11:06
Date: Sun, 06 Apr 2008 11:06
44 lines
2740 bytes
2740 bytes
Witam serdecznie! Mam u siebie dwa komputery: pierwszy robi za router na ktorym stoi Debian i udostepnia polaczenie z internetem drugiemu kompowi z Windowsem XP. Na drugim komputerze postawilem serwer FTP przez program Bullet FTP Server (192.168.1.2). Chcialbym z zewnatrz moc dostac sie na ten serwer za posrednictwem Debiana wpisujac IP zewnetrzne login i haselko. Zrobilem przekierowanie portu ale nie chce dzialac jak trzeba. Oto budowa Firewalla: iptables -F iptables -X iptables -t nat -X iptables -t nat -F iptables -A INPUT -i lo -j ACCEPT iptables -A FORWARD -o lo -j ACCEPT iptables -A INPUT -s 0/0 -d ip.ip.ip -p tcp --dport 22 -j ACCEPT iptables -A OUTPUT -s 0/0 -d ip.ip.ip -p tcp --dport 22 -j ACCEPT iptables -A INPUT -s 0/0 -d ip.ip.ip-p udp --dport 22 -j ACCEPT iptables -A OUTPUT -s 0/0 -d ip.ip.ip -p udp --dport 22 -j ACCEPT iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --set iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m recent --update --seconds 300 --hitcount 3 $ iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED iptables -A FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED iptables -A OUTPUT -j ACCEPT -m state --state ESTABLISHED,RELATED iptables -A FORWARD -p tcp --syn -m limit --limit 1/s -j ACCEPT iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s -j ACCEPT iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit --limit 1/s -j ACCEPT iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT iptables -t nat -A PREROUTING -p tcp -d ip.ip.ip --dport 20:21 -j DNAT --to 192.168.1.2 Na debianie dziala demon FTP vsftpd i na tego dostac sie moge bez problemu. Ale mi chodzi wlasnie o ten FTP ktory stoi za debianem. Ktos wie gdzie jest blad?
Re: Debian gateway - problem z przekierowaniem
Author: rUrek
Date: Sun, 06 Apr 2008 11:53
Date: Sun, 06 Apr 2008 11:53
52 lines
2657 bytes
2657 bytes
Obserwator wrote: > Witam serdecznie! > > Mam u siebie dwa komputery: pierwszy robi za router na ktorym > stoi Debian i udostepnia polaczenie z internetem drugiemu kompowi > z Windowsem XP. Na drugim komputerze postawilem serwer FTP > przez program Bullet FTP Server (192.168.1.2). Chcialbym z zewnatrz > moc dostac sie na ten serwer za posrednictwem Debiana wpisujac > IP zewnetrzne login i haselko. Zrobilem przekierowanie portu ale nie > chce dzialac jak trzeba. Oto budowa Firewalla: > > iptables -F > iptables -X > iptables -t nat -X > iptables -t nat -F > > iptables -A INPUT -i lo -j ACCEPT > iptables -A FORWARD -o lo -j ACCEPT > > iptables -A INPUT -s 0/0 -d ip.ip.ip -p tcp --dport 22 -j ACCEPT > iptables -A OUTPUT -s 0/0 -d ip.ip.ip -p tcp --dport 22 -j ACCEPT > iptables -A INPUT -s 0/0 -d ip.ip.ip-p udp --dport 22 -j ACCEPT > iptables -A OUTPUT -s 0/0 -d ip.ip.ip -p udp --dport 22 -j ACCEPT > iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m > recent --set > iptables -I INPUT -p tcp --dport 22 -i eth0 -m state --state NEW -m > recent --update --seconds 300 --hitcount 3 $ > > iptables -A INPUT -j ACCEPT -m state --state ESTABLISHED,RELATED > iptables -A FORWARD -j ACCEPT -m state --state ESTABLISHED,RELATED > iptables -A OUTPUT -j ACCEPT -m state --state ESTABLISHED,RELATED > iptables -A FORWARD -p tcp --syn -m limit --limit 1/s -j ACCEPT > iptables -A FORWARD -p icmp --icmp-type echo-request -m limit --limit 1/s > -j ACCEPT > iptables -A FORWARD -p tcp --tcp-flags SYN,ACK,FIN,RST RST -m limit > --limit 1/s -j ACCEPT > > iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -j MASQUERADE > iptables -A FORWARD -s 192.168.1.0/24 -j ACCEPT > iptables -t nat -A PREROUTING -p tcp -d ip.ip.ip --dport 20:21 -j DNAT > --to 192.168.1.2 > (...) active, passive? może być konieczne załadowanie modułu do śledzenia połączeń ftp, i dorzucenie do łańcucha z ftp -state RELATED pzdr -- rUrek
Re: Debian gateway - problem z przekierowaniem
Author: adam.dabrow
Date: Mon, 07 Apr 2008 08:45
Date: Mon, 07 Apr 2008 08:45
10 lines
1559 bytes
1559 bytes
> active, passive? > może być konieczne załadowanie modułu do śledzenia połączeń ftp, > i dorzucenie do łańcucha z ftp -state RELATED Tryb pasywny - port 21 - czyli tak zeby oczekiwal na przychodzace polaczenia masz na mysli ip_conntrack_ftp ? Z tego co mi wiadomo Linux samodzielnie laduje ten modul Sproboje dorzucic ten lancuch
Re: Debian gateway - problem z przekierowaniem
Author: Lopez
Date: Mon, 07 Apr 2008 20:37
Date: Mon, 07 Apr 2008 20:37
9 lines
1187 bytes
1187 bytes
adam.dabrow@gmail.com pisze: > masz na mysli ip_conntrack_ftp ? > Z tego co mi wiadomo Linux samodzielnie laduje ten modul Z mojego doświadczenia wynika, że Debian etch nie ładuje ;) -- Pozdrawiam Lopez
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads