🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: alt.pl.comp.os.linux.debian
Article #29545

Re: Debian gateway - problem z przekierowaniem

#29545
From: rUrek
Date: Sun, 06 Apr 2008 11:53
52 lines
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
Technical Details
Message-ID: <ftadki$edg$1@aioe.org>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news.nask.pl!news.nask.org.pl!news.germany.com!aioe.org!not-for-mail
References: <ftaapb$tft$1@node2.news.atman.pl>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!nf1.ipartners.pl!ipartners.pl!news.nask.pl!news.nask.org.pl!news.germany.com!aioe.org!not-for-mail
From: rUrek <rurusNIESPAMPROSZE@o2.pl>
Newsgroups: alt.pl.comp.os.linux.debian
Subject: Re: Debian gateway - problem z przekierowaniem
Date: Sun, 06 Apr 2008 13:53:54 +0200
Organization: Aioe.org NNTP Server
Lines: 52
Message-ID: <ftadki$edg$1@aioe.org>
References: <ftaapb$tft$1@node2.news.atman.pl>
NNTP-Posting-Host: FGDiCyULEtEPOlsPhzBikw.user.aioe.org
Mime-Version: 1.0
X-Complaints-To: abuse@aioe.org
User-Agent: KNode/0.10.9
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit