[LINUX] Ftp, squid en IP-problemen

Pagina: 1
Acties:

  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
Vanaf mijn client kan ik niet ftp'en, vanaf de server wel.
Ook heb ik problemen met Squid. Hij start wel, maar ik kan niet connecten door 192.168.0.1:3128

Volgens mij heeft het probleem met FTP te maken met het feit dat de server de client's IP-adres doorstuurt en niet het IP-adres van de server zelf (192.168.0.1). Dit heet toch IP-Masquerading, of zoiets?

Hoe krijg ik het goed dat ik onderstaand probleem met FTP niet meer heb (en misschien is het probleem met squid dan ook opgelost?).

STATUS:>Connect: Sunday 20:05:17 03-24-2002
STATUS:>Connecting to elektron.its.tudelft.nl
STATUS:>Connecting to elektron.its.tudelft.nl (ip = 130.161.33.15)
STATUS:>Socket connected. Waiting for welcome message...
220 elektron FTP server (Version 1.7.212.4 Tue Sep 12 04:33:08 GMT 2000) ready.
STATUS:>Connected. Authenticating...
COMMAND:>USER borsboom
331 Password required for borsboom.
COMMAND:>PASS ********
230 User borsboom logged in.
STATUS:>Login successful
COMMAND:>TYPE I
200 Type set to I.
COMMAND:>pwd
257 "/users/elektron/h3/students/borsboom" is current directory.
COMMAND:>TYPE A
200 Type set to A.
STATUS:>Retrieving directory listing...
COMMAND:>PORT 192,168,0,110,6,178
500 PORT command failure.
STATUS:>Error opening data socket



PORT 192,168,0,110,6,178 (is dus niet de server.. right?)

Hoe los ik dit op? :?

Plannen is voor loosers


Verwijderd

Wat voor os hebben we het hier over?

Ik gok linux? Neem aan dat je masquerading hebt draaien? Heb je ook die ftp module geladen zodat je op je clients ook active ftp kan gebruiken?

Kortom, meer info graag.

  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
OS: Linux Mandrake 8.1 (zie onderwerp!)
Server IP: 192.168.0.1
DHCP draait
FTP op server werkt
Squid draait

Ik heb geen idee of ik masquerading hebt draaien... Dat kan de boosdoener zijn, hoor. Ik weet ook niet hoe ik dat kan controleren en/of instellen.

Wel heb ik (gezien in een andere forumvraag) geprobeer om te doen: modprobe ip_masq_ftp, maar deze module kon niet gevonden worden.

Hoe moet ik te werk gaan? :?

Plannen is voor loosers


  • _nethack
  • Registratie: September 2000
  • Laatst online: 15:01

_nethack

We're all MAD here

Je hebt waarschijnlijk een 2.4 kernel met iptables ipv ipchains.
Probeer het eens met 'modprobe ip_conntrack_ftp' in plaats van 'modprobe ip_masq_ftp'

Sometimes you just have to sit back, relax, and let the train wreck itself


  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
Even tussendoor, de firewall (iptables inderdaad) geeft na "iptables --list | grep domain" terug:

[root@Apex squid]# modprobe ip_conntrack_ftp
[root@Apex squid]# iptables --list | grep domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain

"modprobe ip_conntrack_ftp" wordt wel geaccepteerd, maar heeft geen invloed op de ftp-procedure. Ik krijg nog steeds dezelfde foutmelding.

Wat nu? :?

Plannen is voor loosers


Verwijderd

Als je de output van lsmod hier post kunnen we zien welke modules er nog meer draaien.

  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
Op uw verzoek ;)

[root@Apex squid]# lsmod
Module Size Used by
nfsd 70464 8 (autoclean)
lockd 51440 1 (autoclean) [nfsd]
sunrpc 66480 1 (autoclean) [nfsd lockd]
af_packet 12560 1 (autoclean)
ip_vs 62000 0 (autoclean)
ipt_REJECT 3312 2 (autoclean)
ipt_limit 1280 10 (autoclean)
ipt_state 944 12 (autoclean)
ipt_LOG 3776 10
ip_conntrack_ftp 3792 0 (unused)
iptable_mangle 2048 0 (autoclean) (unused)
hisax 514864 3 (autoclean)
isdn 127184 3 (autoclean) [hisax]
slhc 5136 2 (autoclean) [isdn]
usb-uhci 21232 0 (unused)
usbcore 50752 1 [usb-uhci]
8139too 12704 1 (autoclean)
iptable_filter 2048 0 (autoclean) (unused)
ipt_MASQUERADE 1600 1 (autoclean)
iptable_nat 16560 0 [ipt_MASQUERADE]
ip_tables 11488 10 [ipt_REJECT ipt_limit ipt_state ipt_LOG iptabl
e_mangle iptable_filter ipt_MASQUERADE iptable_nat]
ip_conntrack 15600 3 [ipt_state ip_conntrack_ftp ipt_MASQUERADE ipt
able_nat]
rtc 5600 0 (autoclean)
[root@Apex squid]#

Plannen is voor loosers


  • Newjersey
  • Registratie: November 2000
  • Laatst online: 10-08 23:25
PASV ftp misschien aanzetten :?

  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
Nee, dit heb ik al geprobeerd en helpt niet.

Als je kijkt naar het IP-adres dat FTP verstuurd naar de FTP-server (de TU), dan zie je dat dat IP-adres van een client is en niet van de server...

Volgens mij moet het IP-adres van de client "ingepakt" worden, zodat het pakketje bij retour eerst naar de server gaat (het uitpakt) en daarna "intern" doorstuurt naar de client.

Maar hoe?!?!?!? :? :?

Plannen is voor loosers


Verwijderd

Kun je misschien ook even je firewall script posten en met "cat /proc/sys/net/ipv4/ip_forward " controleren of ip forwarding wel aan staat (output 1).

  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
Dit geeft:

[root@Apex squid]# cat /proc/sys/net/ipv4/ip_forward
1
[root@Apex squid]#


Ik kan me wel herinneren dat ik een hele tijd geleden het bestand iptables heb verplaatst naar de root-directory, maar waar ik de firewall-script moet vinden... euhhhh?

newbie alert, newbie alert.. hehehe...

Plannen is voor loosers


Verwijderd

Ok, ip forwarding staat dus wel aan. je iptables firewall script vind je meestal /etc/init.d , maar hoe hij precies heet verschilt nog wel eens per distributie.

Anders kan je ook een "iptables -L -t nat" geven.

[edit]
maak er maar een "iptables -L" van

  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
Wooooww... da's een lange :)

Nu is ff kijken...

[root@Apex /]# iptables -L
Chain INPUT (policy DROP)
target prot opt source destination
ACCEPT udp -- anywhere anywhere udp spt:bootpc dpt:b
ootps
ACCEPT tcp -- anywhere anywhere tcp spt:bootpc dpt:b
ootps
ACCEPT udp -- anywhere anywhere udp spt:bootps dpt:b
ootpc
ACCEPT tcp -- anywhere anywhere tcp spt:bootps dpt:b
ootpc
ACCEPT udp -- anywhere anywhere udp dpt:domain
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
DROP tcp -- anywhere 127.0.0.0/8
ACCEPT all -- anywhere anywhere state RELATED,ESTABL
ISHED
ACCEPT all -- anywhere anywhere
DROP all -- BASE-ADDRESS.MCAST.NET/4 anywhere
INT_IN all -- anywhere anywhere
PUB_IN all -- anywhere anywhere
PUB_IN all -- anywhere anywhere
PUB_IN all -- anywhere anywhere

Chain FORWARD (policy DROP)
target prot opt source destination
ACCEPT all -- 192.168.0.0/24 anywhere
ACCEPT all -- anywhere anywhere state RELATED,ESTABL
ISHED

Chain OUTPUT (policy ACCEPT)
target prot opt source destination
INT_OUT all -- anywhere anywhere
PUB_OUT all -- anywhere anywhere
PUB_OUT all -- anywhere anywhere
PUB_OUT all -- anywhere anywhere

Chain INT_IN (1 references)
target prot opt source destination
ACCEPT icmp -- anywhere anywhere
DROP all -- anywhere anywhere

Chain INT_OUT (1 references)
target prot opt source destination
ACCEPT icmp -- anywhere anywhere
ACCEPT all -- anywhere anywhere

Chain PUB_IN (3 references)
target prot opt source destination
ACCEPT icmp -- anywhere anywhere icmp destination-unr
eachable
ACCEPT icmp -- anywhere anywhere icmp echo-reply
ACCEPT icmp -- anywhere anywhere icmp time-exceeded
ACCEPT tcp -- anywhere anywhere tcp dpt:http
ACCEPT tcp -- anywhere anywhere tcp dpt:https
ACCEPT tcp -- anywhere anywhere tcp dpt:ssh
ACCEPT tcp -- anywhere anywhere tcp dpt:domain
ACCEPT udp -- anywhere anywhere udp dpt:domain
LOG tcp -- anywhere anywhere tcp dpt:telnet state
INVALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
LOG tcp -- anywhere anywhere tcp dpt:ftp state IN
VALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
LOG tcp -- anywhere anywhere tcp dpt:imap state I
NVALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
LOG tcp -- anywhere anywhere tcp dpt:pop3 state I
NVALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
LOG tcp -- anywhere anywhere tcp dpt:finger state
INVALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
LOG tcp -- anywhere anywhere tcp dpt:sunrpc state
INVALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
LOG tcp -- anywhere anywhere tcp dpt:exec state I
NVALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
LOG tcp -- anywhere anywhere tcp dpt:login state
INVALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
LOG tcp -- anywhere anywhere tcp dpt:ssh state IN
VALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
LOG udp -- anywhere anywhere udp dpt:31337 state
INVALID,NEW limit: avg 5/sec burst 8 LOG level warning prefix `audit'
DROP icmp -- anywhere anywhere
DROP all -- anywhere anywhere

Chain PUB_OUT (3 references)
target prot opt source destination
REJECT icmp -- anywhere anywhere icmp destination-unr
eachable reject-with icmp-port-unreachable
REJECT icmp -- anywhere anywhere icmp time-exceeded r
eject-with icmp-port-unreachable
ACCEPT all -- anywhere anywhere
[root@Apex /]#

En nu....?

Plannen is voor loosers


Verwijderd

Ik moet zeggen dat ik nog niet zo'n hele grote iptables expert ben, (meer ipchains) maar ik zie zo geen vreemde dingen.

Probeer je toevallig je ftp sessies ook via squid te laten verlopen?

  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
Nope...

FTP gaat (op de client althans) braaf via port 21/20... Anders gezegd, er is niks veranderd op client sinds ik een Windows machine heb "ingeruild" voor een Linuxserver..

Ohoh, gaat dit nog wel lukken?!? ;(

Plannen is voor loosers


  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
Kan je aan die iptables dan zien of het probleem daarin zit? Zoniet, waar zit het dan wel in?!? :?

Plannen is voor loosers


  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
Ehhmm? Help? (please... :-) )

Plannen is voor loosers


  • ArthurBorsboom
  • Registratie: Januari 2001
  • Laatst online: 11-08 16:29
echt niemand die een oplossing weet? (of wil geven?) please?

Plannen is voor loosers

Pagina: 1