From: Olvin <olvin@rambler.ru>
To: Vitalik Salomatin <chelroot74@mail.ru>,
ALT Linux Community general discussions
<community@lists.altlinux.org>
Subject: Re: [Comm] FTP не работает через проброшенный порт. SSH и HTTP работают.
Date: Wed, 01 Oct 2008 15:00:13 +0300
Message-ID: <48E3664D.2090204@rambler.ru> (raw)
In-Reply-To: <E1KjS28-00093I-00.chelroot74-mail-ru@f106.mail.ru>
Vitalik Salomatin пишет:
> ALT 4.0 сервер смотрит наружу и имеет внутреннюю сеть.
> командами
> #iptables -t nat -A PREROUTING -d 11.11.11.61 -p
> tcp --destination-port 21 -j DNAT --to-destination 10.0.0.112
> #iptables -t nat -A POSTROUTING -o eth2 -s 10.0.0.122 -j
> MASQUERADE
> пробрасываю через него 21 порт на 122 машину внутри сети для
> связи с FTP
> соединяется, принимает пароль, а потом пишет:
> Чтение каталога FTP
> и виснет
> 22 порт и 80 пробрасываются удачно.
> Что я еще не сделал?
$CLIENTIP - клиент, который хочет достучаться до внешнего FTP-сервера
$NATSRVIP1 - адрес шлюза, который смотрит в нашу сеть
$NATSRVIP2 - адрес шлюза, который смотрит во внешнюю сеть
$DSTSRVIP - адрес внешнего FTP-сервера
Доступ к удалённому серверу из нашей сети:
$ lftp $NATSRVIP1
Для этого делаем:
modprobe ip_conntrack_ftp
modprobe ip_nat_ftp
iptables -t nat -A PREROUTING -s $CLIENTIP -d $NATSRVIP1 -p tcp --dport
21 -j DNAT --to-destination $DSTSRVIP
iptables -t nat -A PREROUTING -s $DSTSRVIP -d $NATSRVIP2 -p tcp --sport
21 -j DNAT --to-destination $CLIENTIP
iptables -t nat -A POSTROUTING -s $CLIENTIP -d $DSTSRVIP -p tcp --dport
21 -j SNAT --to-source $NATSRVIP2
iptables -t nat -A POSTROUTING -s $DSTSRVIP -d $CLIENTIP -p tcp --sport
21 -j SNAT --to-source $NATSRVIP1
iptables -A FORWARD -m state --state ESTABLISHED -j ACCEPT
iptables -A FORWARD -m state --state RELATED -j ACCEPT
iptables -A FORWARD -s $CLIENTIP -d $DSTSRVIP -p tcp --dport 21 -j ACCEPT
Работает.
next prev parent reply other threads:[~2008-10-01 12:00 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-09-27 5:07 Vitalik Salomatin
2008-09-27 5:12 ` Yury Konovalov
2008-09-27 5:28 ` Starodumoff Ilya
2008-09-27 5:29 ` Dmitriy M. Maslennikov
2008-09-27 18:27 ` [Comm] FTP не работает через проброшенный порт Michael Shigorin
2008-09-27 18:32 ` Vyatcheslav Perevalov
2008-09-27 18:35 ` Michael Shigorin
2008-09-27 18:45 ` Vyatcheslav Perevalov
2008-09-27 19:00 ` Michael Shigorin
2008-09-28 6:15 ` Dmitriy M. Maslennikov
2008-10-01 12:00 ` Olvin [this message]
2008-10-01 12:09 ` [Comm] FTP не работает через проброшенный порт. SSH и HTTP работают Kulik Dmitriy
2008-10-01 19:48 ` Olvin
2008-10-01 19:59 ` Kulik Dmitriy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=48E3664D.2090204@rambler.ru \
--to=olvin@rambler.ru \
--cc=chelroot74@mail.ru \
--cc=community@lists.altlinux.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git