* Re: [Comm] tcp port mapping
@ 2004-03-17 7:27 ` Alexey Morsov
2004-03-17 9:26 ` Alexey Morsov
1 sibling, 0 replies; 2+ messages in thread
From: Alexey Morsov @ 2004-03-17 7:27 UTC (permalink / raw)
To: community
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
--
С наилучшими пожеланиями,
Алексей.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [Comm] tcp port mapping
2004-03-17 7:27 ` [Comm] tcp port mapping Alexey Morsov
@ 2004-03-17 9:26 ` Alexey Morsov
1 sibling, 0 replies; 2+ messages in thread
From: Alexey Morsov @ 2004-03-17 9:26 UTC (permalink / raw)
To: community
Nick S. Grechukh wrote:
> В сообщении от Вторник 16 Март 2004 19:07 Alexey Morsov написал(a):
Что-то не нравиться мне этот mapping. Вообщем вопрос следующий:
что выгодней удобнее и кошернее - разрешить в FORWARD
соответствующие порты для конекта ТУДА и отклика ОТ ТУДА и
завернуть их в цепочки для обсчета или стоит поднять еще и SOCKS
сервер (nec или dante?) - но это все на одной машние со squid-ом
--
С наилучшими пожеланиями,
Алексей.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-17 9:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-17 7:27 ` [Comm] tcp port mapping Alexey Morsov
2004-03-17 9:26 ` Alexey Morsov
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