ALT Linux sysadmins discussion
 help / color / mirror / Atom feed
From: "Караваев Павел" <pppd@yandex.ru>
To: ALT Linux sysadmins discussion <sysadmins@lists.altlinux.org>
Subject: [Sysadmins] Зеркалирование трафика на соседний хост
Date: Fri, 20 Jun 2014 13:28:51 +0400
Message-ID: <8399321403256531@web23m.yandex.ru> (raw)

День добрый.
Стоит задача зеркалировать трафик, проходящий через шлюз для фильтрации на соседнем сервере. На этом "соседе" прибывшие пакеты через

iptables -t mangle -A PREROUTING -s x.x.x.x/32 -p tcp -m tcp --dport 80 -j NFQUEUE --queue-num 0 --queue-bypass

попадают в фильтр  https://github.com/ircop/nfq_filter.

Зеркалирую трафик со шлюза таким образом:

iptables -t mangle -A PREROUTING -s x.x.x.x/32 -i eth0 -p tcp --dport 80 -j TEE --gateway 192.168.0.2

Все выглядит нормальным, пакеты до соседа ходят, запрещенные страницы блокируются. В течение нескольких дней все отлично. Но стоит только вместо одного ip сделать зеркалирование _всего_ трафика:

iptables -t mangle -A PREROUTING -s a.a.a.0/22 -i eth0 -p tcp --dport 80 -j TEE --gateway 192.168.0.2
iptables -t mangle -A PREROUTING -s a.a.a.0/22 -i eth2 -p tcp --dport 80 -j TEE --gateway 192.168.0.2
iptables -t mangle -A PREROUTING -s a.a.a.0/22 -i eth5 -p tcp --dport 80 -j TEE --gateway 192.168.0.2

iptables -t mangle -A PREROUTING -s b.b.b.0/22 -i eth0 -p tcp --dport 80 -j TEE --gateway 192.168.0.2
iptables -t mangle -A PREROUTING -s b.b.b.0/22 -i eth2 -p tcp --dport 80 -j TEE --gateway 192.168.0.2
iptables -t mangle -A PREROUTING -s b.b.b.0/22 -i eth5 -p tcp --dport 80 -j TEE --gateway 192.168.0.2

iptables -t mangle -A PREROUTING -s c.c.c.0/21 -i eth0 -p tcp --dport 80 -j TEE --gateway 192.168.0.2
iptables -t mangle -A PREROUTING -s c.c.c.0/21 -i eth2 -p tcp --dport 80 -j TEE --gateway 192.168.0.2
iptables -t mangle -A PREROUTING -s c.c.c.0/21 -i eth5 -p tcp --dport 80 -j TEE --gateway 192.168.0.2

iptables -t mangle -A PREROUTING -s d.d.d.0/22 -i eth0 -p tcp --dport 80 -j TEE --gateway 192.168.0.2
iptables -t mangle -A PREROUTING -s d.d.d.0/22 -i eth2 -p tcp --dport 80 -j TEE --gateway 192.168.0.2
iptables -t mangle -A PREROUTING -s d.d.d.0/22 -i eth5 -p tcp --dport 80 -j TEE --gateway 192.168.0.2

через несколько минут получаю на соседе глухой зависон. Только reset. После загрузки - в логах все чисто, нигде никакого намека, что была проблема. Трафик получается небольшой, порядка 20-30 МБит. Если зеркалировать не все сети (уменьшить трафик), работает дольше.
Ломаю голову, как диагностировать проблему... 


             reply	other threads:[~2014-06-20  9:28 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-20  9:28 Караваев Павел [this message]
2014-06-20  9:33 ` Anton Farygin
2014-06-20 11:24   ` Павел Караваев
2014-06-20 11:32     ` Павел Караваев
2014-06-20 11:35     ` Anton Farygin
2014-06-26 10:21     ` Anton Farygin
2014-06-20  9:46 ` Anton Gorlov

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=8399321403256531@web23m.yandex.ru \
    --to=pppd@yandex.ru \
    --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