ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Yuri Ryazantsev <yuri@unix.ru>
To: mandrake-russian@altlinux.ru
Subject: [mdk-re] iptables and nat
Date: Thu Aug 23 11:50:01 2001
Message-ID: <20010823115046.B15227@mail.unix.ru> (raw)

Приветствую, всех!!

Прошу помощи!! 
Столкнулся со следующей задачей (на самом деле кофигурация сложнее, но я в
описании ее упрощаю, для того чтобы понять суть проблемы. Так что не
предлагайте изменить конфигурацию для того чтобы исчезла задача):

Имеется подключение к Инету и два реальных адреса, а также локальная сеть.
Ставлю комп (Linux 2.4, iptables) с двумя сетевыми картами:

eth0     -> 192.168.64.0/24 (локальная сеть)
eth1     -> 194.1.1.1 (Интернет адрес, для примера)
eth1:0   -> 194.1.1.2 (Второй адрес)

Теперь хочу чтобы ВСЕ пакеты по адресу 194.1.1.2 попадали на машину
192.168.64.100 (подмена машины).

Пишу в /etc/sysconfig/iptables

*nat
:PREROUTING ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]

-A PREROUTING -d 194.1.1.2 -j DNAT --to 192.168.64.100
-A POSTROUTING -o eth1 -s 192.168.64.100 -j SNAT --to 194.1.1.2

После этого разрешаю в DNS 194.1.1.2 = www.xxxx.ru и получаю почти полный
восторг. Весь мир видит этот сервер по http://www.xxxx.ru/ КРОМЕ ЛОКАЛЬНОЙ
СЕТИ.

Можно не обьяснять почему это происходит (это я понимаю). Меня интересует:
как оставив машину в этой локальной сети добится чтобы ее видели по внешнему
адресу ВСЕ?

with best wishes,

Yuri.




                 reply	other threads:[~2001-08-23 11:50 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20010823115046.B15227@mail.unix.ru \
    --to=yuri@unix.ru \
    --cc=mandrake-russian@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