From: Alexey Morsov <samurai@ricom.ru>
To: community@altlinux.ru
Subject: Re: [Comm] tcp port mapping
Date: Wed, 17 Mar 2004 10:27:54 +0300
Message-ID: <4057FDFA.2040504@ricom.ru> (raw)
In-Reply-To: <200403161935.03095.ngrechukh@ua.fm>
Nick S. Grechukh wrote:
> В сообщении от Вторник 16 Март 2004 19:07 Alexey Morsov написал(a):
>
>>Привет,
>>
>>Нужно сделать такую вещь - tcp port mapping, так что бы
>>клиентская машина обращалась к маршрутизатору по порту скажем
>>10000 а тот мапил бы этот запрос в инет на порт 20000 ну и
>>соответственно чтобы отклик радботал.
>>Через FORWARD открывать не хочу а как провернуть через INPUT
>>OUTPUT и -t nat честно говоря ума не приложу?
>>
>>Или может проще поднять SOCKS сервер и не мучить iptables? Если
>>да - то какой?
>
>
> пункт раз:
> можно через xinetd, я так делал.
А можно поподробнее?
>
> пункт два:
> но идея такая:
> 1)входящие с клиента на порт 10000 - маскарадить исходящий адрес - внешний
> адрес шлюза, destination порт - 20000.
> 2)входящие с порта 10000 сервера (снаружи) - мапить исходящий порт - 20000,
> исходящий ip - внутренний адрес шлюза.
>
> что-то вроде
> serv_ip=ip_внешнего_сервака
> local_ip=ip_локального_интерфейса
> local_eth=eth0 ## локальный интерфейс
> inet_ip=ip_внешнего_интерфейса
> inet_eth=ppp0 ## внешний интерфейс
>
> iptables -t nat -A PREROUTING -p tcp -d $local_ip --dport 10000 -j DNAT
> --to-destination $serv_ip:20000
> iptables -A FORWARD -i $local_eth -d $serv_ip -p tcp --dport 20000 -j ACCEPT
> iptables -t nat -A POSTROUTING -o $inet_eth -j SNAT --from $inet_ip
> это первая часть.
> вторую часть в синтаксисе iptables сходу не скажу, man iptables.
Господа - а через squid это протащить никак не получиться? (мне в
плане того чтоб счетчик трафика per/user не собирать с разных
улов (счас то у меня цепочка FORWARD вообще закрыта и даже
маскарада нет)
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Community mailing list
> Community@altlinux.ru
> http://www.altlinux.ru/mailman/listinfo/community
--
С наилучшими пожеланиями,
Алексей.
next parent reply other threads:[~2004-03-17 7:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-17 7:27 ` Alexey Morsov [this message]
2004-03-17 9:26 ` Alexey Morsov
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=4057FDFA.2040504@ricom.ru \
--to=samurai@ricom.ru \
--cc=community@altlinux.ru \
/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