From: Ruslan Spivak <alienoid@is.lg.ua>
To: lartc@vger.kernel.org
Subject: [LARTC] Traffic control + NAT + HTB
Date: Wed, 28 May 2003 09:54:05 +0000 [thread overview]
Message-ID: <marc-lartc-105411564511346@msgid-missing> (raw)
Hello, lart? users!
Can you help me understand hot to make HTB work with NAT in my situation?
---------------
| linux | eth0 -------
| 193.220.70.33 |------|switch |--|cisco|<-->internet
| NAT | ---------
----------------- |
|
------------ eth0 |
client1 |-------------
192.168.1.1 |
-------------
Client's(192.168.1.2) default route is to 193.220.70.33
On linux server(193.220.70.33) there is rule:
iptables -t nat -A POSTROUTING -s 192.168.0.0/16 -o eth0 -j SNAT --to
193.220.70.33
As i understand i can control traffic bandwidth going to client1 and
from client1 on linux server due to one interface on linux server.(maybe
i'm wrong)
On linux server i need to mark packets with iptables and then use fw to
put that packets in corresponding class. I'm not sure about hot to do
that if i have NAT on linux server eth0. For example:
/usr/local/iproute2/sbin/tc qdisc add dev eth0 root handle 1: htb
/usr/local/iproute2/sbin/tc class add dev eth0 parent 1:1 classid 1:20
htb rate 32kbit ceil 60Mbit
/usr/local/iproute2/sbin/tc qdisc add dev eth0 parent 1:20 handle 20: sfq
/usr/local/iproute2/sbin/tc filter add dev eth0 parent 1:0 protocol ip
handle 1 fw flowid 1:20
/sbin/iptables -t mangle -A POSTROUTING -s 192.168.1.2 -j MARK --set-mark 1
Will be packet with src 192.168.1.2 put into classid 1:20, or for that
moment it will be already nated and his source will be 193.220.70.33?
Looking at 'Kernel Packet Traveling Diagram' at docum.org, i may suggest
, that it will be marked and put before it will be nated, but if you
can give advice about that i will greatly appreciate that.
Thanks a lot for your help.
Bets regards,
Ruslan
_______________________________________________
LARTC mailing list / LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
next reply other threads:[~2003-05-28 9:54 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-28 9:54 Ruslan Spivak [this message]
2003-05-28 13:27 ` [LARTC] Traffic control + NAT + HTB Martin A. Brown
2003-05-28 22:39 ` Ruslan Spivak
2003-05-28 22:43 ` Martin A. Brown
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=marc-lartc-105411564511346@msgid-missing \
--to=alienoid@is.lg.ua \
--cc=lartc@vger.kernel.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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.