It seems I have quite a difficult (for me) bandwidth shaping problem. What I want is this; Port 80 and port 21 will share 30 kilobytes of the 50kilobytes upstream my ISP gives me, bittorrent will get 10 maximum (ports 6881-6890), and all other ports get the full 100 mbits. I want any of the other ports to be able to steal the bandwidth of the port 21 and port 80 as well as the bittorrent ports if they are not in use, however bittorrent, or port 21 or 80 cannot exceed thier bandwidth limitations. This is because I use my server as a samba server as well as a vnc server from within my network so I want as high a bandwidth as possible on those, however my HTTP server and FTP server and Bittorrent can''t kill my internet connection for everyone else. My current configuration looks like tc qdisk add dev eth0 root handle 1: htb default 30 tc class add dev eth0 parent 1: classid 1:1 htb rate 95mbit burst 15k tc class add dev eth0 parent 1:1 classid 1:10 htb rate 320kbit burst 15k tc class add dev eth0 parent 1:1 classid 1:20 htb rate 1kbit ceil 90mbit burst 15k tc class add dev eth0 parent 1:1 classid 1:30 htb rate 1kbit ceil 90mbit burst 15k tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10 tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10 tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10\ U32="tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32" $U32 match ip sport 80 0xffff flowid 1:10 $U32 match ip sport 21 0xffff flowid 1:20 I sort of fiddled with one of the configurations in the book to get this, also this does not include the bittorrent ports which is a requirement I thought of just recently. I need, first a way to implement the bandwidth restrictions described above, and second a way to remove my old configuration (if I can''t just overwrite it) Thanks alot :) -- Ryan Vilim <rvilim@tbaytel.net> _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Wednesday 29 October 2003 22:35, Ryan Vilim wrote:> It seems I have quite a difficult (for me) bandwidth shaping problem. > What I want is this; > > Port 80 and port 21 will share 30 kilobytes of the 50kilobytes upstream > my ISP gives me, bittorrent will get 10 maximum (ports 6881-6890), and > all other ports get the full 100 mbits. > > I want any of the other ports to be able to steal the bandwidth of the > port 21 and port 80 as well as the bittorrent ports if they are not in > use, however bittorrent, or port 21 or 80 cannot exceed thier bandwidth > limitations. > > This is because I use my server as a samba server as well as a vnc > server from within my network so I want as high a bandwidth as possible > on those, however my HTTP server and FTP server and Bittorrent can''t > kill my internet connection for everyone else. > > My current configuration looks like > > tc qdisk add dev eth0 root handle 1: htb default 30It''s "tc qdisc ..."> tc class add dev eth0 parent 1: classid 1:1 htb rate 95mbit burst 15k > tc class add dev eth0 parent 1:1 classid 1:10 htb rate 320kbit burst 15k > tc class add dev eth0 parent 1:1 classid 1:20 htb rate 1kbit ceil 90mbit > burst 15k > tc class add dev eth0 parent 1:1 classid 1:30 htb rate 1kbit ceil 90mbit > burst 15k > tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10 > tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10 > tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10\If eht0 is connected to the internet, the ceil should be your internet link. Not your NIC bandwidth.> U32="tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32" > $U32 match ip sport 80 0xffff flowid 1:10 > $U32 match ip sport 21 0xffff flowid 1:20 > > I sort of fiddled with one of the configurations in the book to get > this, also this does not include the bittorrent ports which is a > requirement I thought of just recently. > > I need, first a way to implement the bandwidth restrictions described > above, and second a way to remove my old configuration (if I can''t just > overwrite it)/qos/bin/tc qdisc del dev eth0 root Stef -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.openprojects.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thu, 2003-10-30 at 05:32, Stef Coene wrote:> On Wednesday 29 October 2003 22:35, Ryan Vilim wrote: > > It seems I have quite a difficult (for me) bandwidth shaping problem. > > What I want is this; > > > > Port 80 and port 21 will share 30 kilobytes of the 50kilobytes upstream > > my ISP gives me, bittorrent will get 10 maximum (ports 6881-6890), and > > all other ports get the full 100 mbits. > > > > I want any of the other ports to be able to steal the bandwidth of the > > port 21 and port 80 as well as the bittorrent ports if they are not in > > use, however bittorrent, or port 21 or 80 cannot exceed thier bandwidth > > limitations. > > > > This is because I use my server as a samba server as well as a vnc > > server from within my network so I want as high a bandwidth as possible > > on those, however my HTTP server and FTP server and Bittorrent can''t > > kill my internet connection for everyone else. > > > > My current configuration looks like > > > > tc qdisk add dev eth0 root handle 1: htb default 30 > It''s "tc qdisc ..." > > > tc class add dev eth0 parent 1: classid 1:1 htb rate 95mbit burst 15k > > tc class add dev eth0 parent 1:1 classid 1:10 htb rate 320kbit burst 15k > > tc class add dev eth0 parent 1:1 classid 1:20 htb rate 1kbit ceil 90mbit > > burst 15k > > tc class add dev eth0 parent 1:1 classid 1:30 htb rate 1kbit ceil 90mbit > > burst 15k > > tc qdisc add dev eth0 parent 1:10 handle 10: sfq perturb 10 > > tc qdisc add dev eth0 parent 1:20 handle 20: sfq perturb 10 > > tc qdisc add dev eth0 parent 1:30 handle 30: sfq perturb 10\ > If eht0 is connected to the internet, the ceil should be your internet link. > Not your NIC bandwidth. > > > U32="tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32" > > $U32 match ip sport 80 0xffff flowid 1:10 > > $U32 match ip sport 21 0xffff flowid 1:20 > > > > I sort of fiddled with one of the configurations in the book to get > > this, also this does not include the bittorrent ports which is a > > requirement I thought of just recently. > > > > I need, first a way to implement the bandwidth restrictions described > > above, and second a way to remove my old configuration (if I can''t just > > overwrite it) > /qos/bin/tc qdisc del dev eth0 root > > StefOh, I am sorry I probably should have specified the setup of my network (stupid mistake by me :p). I have a server (linux) a laptop (linux) and my parents computer (windows). These are all connected to the internet via my router which is just a store bought, 4 port wireless routers. I want to control the bandwidth leaving my server on ports 80, 21, and the bittorrent ports because if someone is downoading from my webserver while I am getting anime off bittorrent, then the internet slows to a crawl because all of the upstream is used. Since none of the other computers ever participate in any upload-heavy activities I figure that 10kilobytes per second would be enough for them. However I still want the ability to copy at Ethernet speeds from the samba server on my server, use VNC to control my server (it has an audigy 2 in it so I have my speakers and headphones hooked up to it, then use vnc to controll xmms), and basically do any other miscellaneous high bandwidth activities from within my network. Sorry for not explaining my predicament earlier Thanks Ryan Vilim _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
I had same issue (wanted to control server even though it wasnt doing routing) and added the following to the wondershaper script: #exempt networks (i.e. local lan) EXEMPT=192.168.10.0/24 #added class for internal network traffic (5mbit of a 10mbit link) tc class add dev $DEV parent 1: classid 1:2 cbq rate 5mbit \ allot 1500 prio 4 avpkt 1000 #qdisc tc qdisc add dev $DEV parent 1:2 handle 90: sfq perturb 10 #loop through existing networks for a in $EXEMPT do tc filter add dev $DEV parent 1:0 protocol ip pri 9 u32 \ match ip dst $a flowid 1:2 done This worked fine! The following part however, does not work for some reason. I submitted a help ticket to this list, but it was waiting for moderator approval: #for ingress: tc qdisc add dev $DEV handle ffff: ingress # filter *everything* to it (0.0.0.0/0), drop everything that''s # coming in too fast: #exemptions by jere for a in $EXEMPT do tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \ $a police rate 5mbit burst 15k drop flowid :1 done tc filter add dev $DEV parent ffff: protocol ip prio 50 u32 match ip src \ 0.0.0.0/0 police rate ${DOWNLINK}kbit burst 10k drop flowid :1 Since its not a seperate class, I cant see if the packets are getting matched. Everything is filtered at the second 0.0.0.0/0 police rate. So now i can transfer files quickly from my server, but not to it. any help? _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
On Thursday 30 October 2003 15:34, Ryan Vilim wrote:> Oh, I am sorry I probably should have specified the setup of my network > (stupid mistake by me :p). I have a server (linux) a laptop (linux) and > my parents computer (windows). These are all connected to the internet > via my router which is just a store bought, 4 port wireless routers. I > want to control the bandwidth leaving my server on ports 80, 21, and the > bittorrent ports because if someone is downoading from my webserver > while I am getting anime off bittorrent, then the internet slows to a > crawl because all of the upstream is used. Since none of the other > computers ever participate in any upload-heavy activities I figure that > 10kilobytes per second would be enough for them. However I still want > the ability to copy at Ethernet speeds from the samba server on my > server, use VNC to control my server (it has an audigy 2 in it so I have > my speakers and headphones hooked up to it, then use vnc to controll > xmms), and basically do any other miscellaneous high bandwidth > activities from within my network.For the LAN nic, you have to do something like this (this is for downloads): 1:0 1:1 LAN traffic, rate = 10Mbit-128kbit, ceil = 10mbit-128kbit 1:2 internet traffic, rate = 128kbit 1:20 : port 80, 21 and bittorent 1:21 : other traffic 1:211 : you 1:210 : mom 1:210 : daddy Stef Ps. You don''t need vnc to control xmms : libxmms-perl - Interactive remote control for XMMS (X MultiMedia System) in perl XMMS is a multimedia player for X windows. This perl package contains a ''shell'' for interacting with a running XMMS via IPC to control songs and playing. A perl interface to the XMMS config, remote and other utilities are provided via this package as well. This library exists at http://www.cpan.org xmms-infopipe - General plugin for XMMS, reports real-time information to a pipe. This plugin allows you to read XMMS information from a named pipe. Usable for webpages, irc-clients and where you would like real-time information from XMMS. Shows song position, song, length, playlist position, status (stoped/playing/paused), song title displayed by XMMS and filename. Easy parsable textformat. xmms-shell - XMMS Shell - Interface to control XMMS from the Console. This is a shell to control xmms from the linux-console. You can edit the playlist, change skins, play, control the volume and much more. -- stef.coene@docum.org "Using Linux as bandwidth manager" http://www.docum.org/ #lartc @ irc.openprojects.net _______________________________________________ LARTC mailing list / LARTC@mailman.ds9a.nl http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/