ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: max <max@zlt.ru>
To: community@altlinux.ru
Subject: Re: [Comm] iproute2 и NAT
Date: Wed, 15 Dec 2004 10:41:36 +0500
Message-ID: <41BFCE90.5040403@zlt.ru> (raw)
In-Reply-To: <1823521875.20041214135144@inbox.ru>

Michael Varamashvili пишет:
> Hу здpаcте max,
> 
> Sunday, December 12, 2004, 4:48:34 PM, вы написали:
> 
> m> Michael Varamashvili пишет:
> m> Извените, первый раз неудачно отправилось...
> m> Хотел спросить как это "через раз"?
> m> У меня всё нормально в таком случае работает.
> m> чтобы с маскарадингом проблем не было нужно прописывать правила в 
> m> iptables для этого интерфейса, типа:
> m> iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE, где ppp0 - модем
> m> или
> m> iptables -t nat -A POSTROUTING -o ppp0 - j SNAT --to-source [ip-модема]
> А вы не могли бы кинуть сюда что вы iproute2 говорите?
> 
route add default gw 192.168.1.1 dev eth1 - это шлюз для всех

ip rule add to 213.180.199.0/24 table Manager - маршрут на 
213.180.199.0/24 пойдёт через шлюз определённый для table Manager (нужно 
вначале её создать в /etc/iproute2/rt_tables ) можно использовать не 
"to", а "from". Тогда пакеты с этого адреса (хоть куда, даже на 
локальные адреса ;) пойдут через шлюз определённый для table Manager.

iptables -t mangle -A PREROUTING -s 192.168.1.1 -d ! 
192.168.0.0/255.255.0.0 -j MARK --set-mark 2 - любое правило для метки 
пакета

ip rule add fwmark 2 table Manager - пакет помеченый как "2" пойдёт 
через шлюз определённый для table Manager

ip route add default via 195.54.31.51 dev ppp0 table Manager - шлюз для 
table Manager

ip route flush cache - сбрасываем кеш, для вступления в силу новых правил


-- 
С наилучшими пожеланиями, Баукин Максим max@zlt.ru


  reply	other threads:[~2004-12-15  5:41 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-12 11:36 Michael Varamashvili
2004-12-12 13:42 ` max
2004-12-12 13:48 ` max
2004-12-14 10:51   ` Re[2]: " Michael Varamashvili
2004-12-15  5:41     ` max [this message]
2004-12-12 14:43 ` [Comm] " Michael Shigorin
2004-12-12 15:11   ` Michael Varamashvili

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=41BFCE90.5040403@zlt.ru \
    --to=max@zlt.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