Титла: Proftp & iptables problem Публикувано от: sharky в Feb 18, 2007, 00:41 Значи ситуацията е следната. Преди 2 месеца някаде си събрах една машинка за рутер, и и сложих Slack 8.0 .Доставчика разбира се ми пуска ТТL = 1. Та след много зор накрая успях да си сложа ново за 8.0 ядро 2.4.18 и успешно да го пачна за Iptables. На въпросната машинка пуснах вградения ProFTPd. И сега проблема ми е че от локалната мрежа не мога да Upload-на ништо на FTP-то - прави трансфер на файла до 32к и до там - забива. А иначе си дърпам от него без проблем. Та хрумна ми да пробвам от вънка как са нещата. Отивам на работа и от там се връзвам и си Upload-вам БЕЗ ПРОБЛЕМ. Допитах се до един авер, а той ми каза че имам проблем с настройките на IpTables. и затова ви прилагам моя rc.local . Ще сам много благодарен ако го видите и ми кажете къде греша!
#!/bin/sh # # /etc/rc.d/rc.local: Local system initialization script. # # Put any local setup commands in here: echo Network Down ifconfig eth0 down ifconfig eth1 down ifconfig eth1 hw ether 00:134:02:15:DD echo Network UP ifconfig eth0 192.168.7.1 netmask 255.255.155.248 up echo 1 > /proc/sys/net/ipv4/ip_forward adsl-start route add default gw 84.54.128.37 dev ppp0 /usr/sbin/iptables -F #/usr/sbin/iptables -t nat -F #/usr/sbin/iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE -j SNAT --to 192.168.7.1 /usr/sbin/iptables -I FORWARD -s 192.168.7.1 -j MASQ /usr/sbin/iptables -P FORWARD ACCEPT #/usr/sbin/iptables -t mangle -I PREROUTING -d 192.168.7.0/8 -j TTL --ttl-set 64 /usr/sbin/iptables -t mangle -A PREROUTING -i ppp0 -j TTL --ttl-set 64 /usr/sbin/iptables -t mangle -A POSTROUTING -s 192.168.7.0/8 -o ppp0 -j TTL --ttl-set 64 /usr/sbin/iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE #/usr/sbin/iptables -A PREROUTING -t nat -p tcp --dport 80 -i eth0 -s 192.168.7.0/8 ##/usr/sbin/iptables -A INPUT -p udp -j pudp ##insmod ip_masq_autofw ##ipmasqadm autofw -A -r tcp 20 21 -h 192.168.7.1 proftpd Титла: Proftp & iptables problem Публикувано от: sharky в Feb 19, 2007, 21:38 Ко става ся??Никой ли не иска да ми помогне?
Титла: Proftp & iptables problem Публикувано от: neter в Feb 19, 2007, 21:56 Абе... не че не искаме, ама странна работа ти е проблема. Аз нещо не мога да го възпроизведа. Дай за всеки случай и proftpd.conf файла ти и , ако акаунтите ти се пазят в MySQL база, дай и конфигурацията на MySQL-а!
Титла: Proftp & iptables problem Публикувано от: sharky в Feb 20, 2007, 00:53 Него пък въобще не сам го барал. Само го направих да е Standalone, а не през inetd.
# This is a basic ProFTPD configuration file. # It establishes a single server and a single anonymous login. # It assumes that you have a user/group "nobody" and "ftp" # for normal/anonymous operation. ServerName "Sin_Daemon's FTP Server" ServerType standalone #ServerType inetd DefaultServer on # Port 21 is the standard FTP port. Port 21 # Umask 022 is a good standard umask to prevent new dirs and files # from being group and world writable. Umask 022 # To prevent DoS attacks, set the maximum number of child processes # to 30. If you need to allow more than 30 concurrent connections # at once, simply increase this value. Note that this ONLY works # in standalone mode, in inetd mode you should use an inetd server # that allows you to limit maximum number of processes per service # (such as xinetd) MaxInstances 30 # Set the user and group that the server normally runs at. RootLogin on User nobody Group nogroup SystemLog /var/log/proftpd.log TransferLog /var/log/xferlog # Normally, we want files to be overwriteable. <Directory /*> AllowOverwrite on </Directory> # A basic anonymous FTP server configuration. # To enable this, remove the user ftp from /etc/ftpusers. <Anonymous ~ftp> RequireValidShell off User anonymous Group ftp # We want clients to be able to login with "anonymous" as well as "ftp" UserAlias anonymous ftp # Limit the maximum number of anonymous logins MaxClients 50 # We want 'welcome.msg' displayed at login, and '.message' displayed # in each newly chdired directory. DisplayLogin welcome.msg DisplayFirstChdir .message # Limit WRITE everywhere in the anonymous chroot <Limit WRITE> AllowAll </Limit> # An upload directory that allows storing files but not retrieving # or creating directories. <Directory upload/*> <Limit STOR> AllowAll </Limit> </Directory> </Anonymous> Не знам дали има някакво зна4ение за ситуацията ама клиентската ми машина е с едногигабитова лан карта, а пък рутерчето е с 2 десятки. И между тях има 10 HUB. Ето и лога от Filezillata: Status: Connecting to 192.168.7.1 ... Status: Connected with 192.168.7.1. Waiting for welcome message... Response: 220 ProFTPD 1.2.2rc3 Server (Sin_Daemon's FTP Server) [Sharky.GsmService] Command: USER root Response: 331 Password required for root. Command: PASS ***** Response: 230 User root logged in. Command: SYST Response: 215 UNIX Type: L8 Command: FEAT Response: 500 FEAT not understood. Status: Connected Status: Starting upload of c:\temp\CryptoflexPG_4-5.pdf Command: PWD Response: 257 "/root" is current directory. Command: TYPE A Response: 200 Type set to A. Command: PASV Response: 227 Entering Passive Mode (192,168,7,1,4,30). Command: LIST Response: 150 Opening ASCII mode data connection for file list Response: 226 Transfer complete. Command: TYPE I Response: 200 Type set to I. Command: PASV Response: 227 Entering Passive Mode (192,168,7,1,4,31). Command: APPE CryptoflexPG_4-5.pdf Response: 451 CryptoflexPG_4-5.pdf: Append/Restart not permitted, try again. Command: TYPE A Response: 200 Type set to A. Status: Upload successful Status: Retrieving directory listing... Command: TYPE A Response: 200 Type set to A. Command: PASV Response: 227 Entering Passive Mode (192,168,7,1,4,32). Command: LIST Response: 150 Opening ASCII mode data connection for file list Response: 226 Transfer complete. Status: Directory listing successful Command: TYPE I Command: TYPE A Response: 200 Type set to A. Response: 200 Type set to I. ето и скрииншота: http://www.bgshare.com/files1/215780/screenshot.GIF Титла: Proftp & iptables problem Публикувано от: Bogo в Feb 20, 2007, 05:00 виж зареди някой от тези модули
/lib/modules/2.4.27-2-386/kernel/net/ipv4/netfilter/ip_conntrack_ftp.o /lib/modules/2.4.27-2-386/kernel/net/ipv4/netfilter/ip_conntrack_tftp.o /lib/modules/2.4.27-2-386/kernel/net/ipv4/netfilter/ip_nat_ftp.o /lib/modules/2.4.27-2-386/kernel/net/ipv4/netfilter/ip_nat_tftp.o Титла: Proftp & iptables problem Публикувано от: sharky в Feb 20, 2007, 09:16 Извинявам се много за тъпия въпрос ама - Как се зареждат модули? (все пак съм начинаещ)
в конзолата написах; insmod ip_conntrack_ftp.o insmod ip_nat_ftp.o ама пак същата работа пък ip_conntrack_tftp.o и ip_nat_tftp.o липсват - няма такива модули? Титла: Proftp & iptables problem Публикувано от: VladSun в Feb 20, 2007, 12:03 пробвай:
modprobe ip_conntrack_ftp Титла: Proftp & iptables problem Публикувано от: sharky в Feb 22, 2007, 00:24
Не помага |