The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > IP Networking
Google UNIX.COM


IP Networking Questions involving TCP/IP, Routers, Hubs, Network protocols, etc go here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
mail command woth Postfix piltrafa UNIX for Dummies Questions & Answers 1 12-18-2007 04:34 AM
IPtables 182x IP Networking 1 11-27-2006 10:03 PM
IPtables Jody UNIX for Dummies Questions & Answers 3 05-31-2003 05:08 PM
Ftp'ing thru a Iptables NAT Masquerade phrater IP Networking 2 09-04-2002 10:18 AM
iptables, ftp sTorm UNIX for Dummies Questions & Answers 2 03-18-2002 11:18 PM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-26-2007
Registered User
 

Join Date: Dec 2007
Posts: 1
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Reddit! Stumble this Post!Spurl this Post!
Need help woth iptables

Trying to create a whitelist to limit bandwidth. My sync speed is 1536/256 kbps.

Simple rules in order:

1. Do not limit (or set to 1536/256) MAC 00:00:00:00:00 (computer is in 192.168.1.0/24).
2. Do not limit (or set to 1536/256) MAC 00:00:00:00:01 (computer is in 192.168.1.0/24).
3. Do not limit (or set to 1536/256) MAC 00:00:00:00:02 (computer is in 192.168.1.0/24).
4. Do not limit (or set to 1536/256) MAC 00:00:00:00:03 (computer is in 192.168.1.0/24).
5. Limit IP range 192.168.1.2 -> 192.168.1.254 (or all MAC/IP's) to 500/60 kbps.

This is the code which i was given and it doesnt work

Code:
TCA="tc class add dev br0"
TFA="tc filter add dev br0"
TQA="tc qdisc add dev br0"
SFQ="sfq perturb 10"
tc qdisc del dev br0 root
tc qdisc add dev br0 root handle 1: htb
tc class add dev br0 parent 1: classid 1:1 htb rate 1500kbps
$TCA parent 1:1 classid 1:99 htb rate 1kbps ceil 50kbps prio 2
$TQA parent 1:99 handle 99: $SFQ
$TFA parent 1:0 prio 2 protocol ip handle 99 fw flowid 1:99
iptables -t mangle -A POSTROUTING -m iprange --dst-range 192.168.1.2-192.168.1.254 -j MARK --set-mark 99
TCAU="tc class add dev imq0"
TFAU="tc filter add dev imq0"
TQAU="tc qdisc add dev imq0"
modprobe imq
modprobe ipt_IMQ
ip link set imq0 up
tc qdisc del dev imq0 root
tc qdisc add dev imq0 root handle 1: htb
tc class add dev imq0 parent 1: classid 1:1 htb rate 250kbps
$TCAU parent 1:1 classid 1:10 htb rate 1kbps ceil 250kbps prio 1
$TCAU parent 1:1 classid 1:11 htb rate 1kbps ceil 250kbps prio 1
$TCAU parent 1:1 classid 1:12 htb rate 1kbps ceil 250kbps prio 1
$TCAU parent 1:1 classid 1:13 htb rate 1kbps ceil 250kbps prio 1
$TCAU parent 1:1 classid 1:14 htb rate 1kbps ceil 250kbps prio 1
$TCAU parent 1:1 classid 1:99 htb rate 1kbps ceil 6kbps prio 2
$TQAU parent 1:10 handle 10: $SFQ
$TQAU parent 1:11 handle 11: $SFQ
$TQAU parent 1:12 handle 12: $SFQ
$TQAU parent 1:13 handle 13: $SFQ
$TQAU parent 1:14 handle 14: $SFQ
$TQAU parent 1:99 handle 99: $SFQ
$TFAU parent 1:0 prio 2 protocol ip handle 99 fw flowid 1:99
iptables -t mangle -A PREROUTING -m mac --mac-source 00:00:00:00:00:01 -j MARK --set-mark 10
iptables -t mangle -A PREROUTING -m mac --mac-source 00:00:00:00:00:02 -j MARK --set-mark 11
iptables -t mangle -A PREROUTING -m mac --mac-source 00:00:00:00:00:03 -j MARK --set-mark 12
iptables -t mangle -A PREROUTING -m mac --mac-source 00:00:00:00:00:04 -j MARK --set-mark 13
iptables -t mangle -A PREROUTING -m mac --mac-source 00:00:00:00:00:05 -j MARK --set-mark 14
iptables -t mangle -A PREROUTING -m iprange --src-range 192.168.1.2-192.168.1.254 -j MARK --set-mark 99
iptables -t mangle -A PREROUTING -j IMQ --todev 0
Reply With Quote
Google UNIX.COM
Forum Sponsor
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 04:59 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101