ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
From: Yuriy Kashirin <yura@emict.com>
To: ALT Linux sysadmin discuss <sysadmins@lists.altlinux.org>
Subject: Re: [Sysadmins] AltLinux Server 4.1 настройка файервола для OPENVZ
Date: Thu, 13 Nov 2008 17:58:09 +0200
Message-ID: <200811131758.10276.yura@emict.com> (raw)
In-Reply-To: <c44d5fbe0811130725y3ad9092dw791101a3953fed23@mail.gmail.com>

On 13 ноября 2008, Serg Byalko wrote:
> Здравствуйте!
>
> >> внешний IP eth0 xxx.xxx.xxx.xxx
> >> внешний IP eth1 yyy.yyy.yyy.yyy
> >>
> >> котнейнеры с внутр. адресами
> >> bind  - 172.16.0.100 - открыт порт 53 (DNS)
> >> 222 - 172.16.0.113
> >>
> >> на родительской машине в ipconfig
> >> -A PREROUTING -d xxx.xxx.xxx.xxx -i eth0 -p udp -m udp --dport
> >> 53 -j DNAT --to-destination 172.16.0.100:53
> >> -A PREROUTING -d xxx.xxx.xxx.xxx -i eth0 -p tcp -m tcp --dport
> >> 53 -j DNAT --to-destination 172.16.0.100:53
> >>
> >> Если я в контейнере 222 пытаюсь делать nslookup www.ru
> >> 172.16.0.113 - всё ок А если делаю nslookup www.ru
> >> xxx.xxx.xxx.xxx , то контейнер молчит :((
> >
> > Все правильно, проброс портов будет работать только если заходить
> > на 53 порт адреса xxx.xxx.xxx.xxx снаружи, а не из внутренней
> > подсети.
>
> Из инструкции ниже мне не понятно, какой указывать внутренний адрес
> файервола? Это же одна машина и такого адреса нет :(

Да, немного не тот случай. Тогда для перенаправления между 
контейнерами должно подойти такое:

iptables -t nat -A PREROUTING -d xxx.xxx.xxx.xxx -i venet0 \
  -p udp -m udp --dport 53 \
  -j DNAT --to-destination 172.16.0.100:53

(venet0 может называться по другому - тот интерфейс на HN, через 
который ходит траффик на контейнеры).

>
> >> ВНИМАНИЕ ВОПРОС :)
> >>
> >> как мне необходимо нстроить файервол чтобы из контейнера 222
> >> можно было подключться к порту другого контейнера, обращаясь к
> >> xxx.xxx.xxx.xxx и используюя правило проброса порта из настроек
> >> файервола.
> >
> > Ответ на ваш вопрос есть здесь:
> > http://gazette.linux.ru.net/rus/articles/iptables-tutorial.html#D
> >NATTARGET
> >


-- 
 Best regards
 Yuriy Kashirin

  reply	other threads:[~2008-11-13 15:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-13 11:07 ` Андрей Новосёлов
2008-11-13 11:21 ` Yuriy Kashirin
2008-11-13 15:25   ` Serg Byalko
2008-11-13 15:58     ` Yuriy Kashirin [this message]
2008-11-13 11:24 ` Anton Kvashin

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=200811131758.10276.yura@emict.com \
    --to=yura@emict.com \
    --cc=sysadmins@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 sysadmins discussion

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sysadmins/0 sysadmins/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 sysadmins sysadmins/ http://lore.altlinux.org/sysadmins \
		sysadmins@lists.altlinux.org sysadmins@lists.altlinux.ru sysadmins@lists.altlinux.com
	public-inbox-index sysadmins

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.sysadmins


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git