Divide Bandwith

Hi,

I'm brazilian, sorry for my english.

I have two LAN and need divide the bandwith.

LAN 2 need have at most 50%, and more the percentual not used by LAN1.

LAN 1 have no limits.

Somebody recommend some program to make this ?
 
What is the reasoning behind dividing the bandwidth? Are you trying to throttle certain types of traffic? Have you looked at Quality of Service or web proxies?
 
I would set static IP's then use traffic shaping/QoS on a router. I use FreeBSD for my firewalls and servers but I use vyatta for my routers which is capable of doing what you want (rate limiting). What are you using for your router?
 
Code:
ext_if="sis0"
lenke="rl0"
wmw="rl1"

####CONTROLE DE TRAFEGO PARA A INTERFACE ext_if
#altq on $ext_if cbq bandwidth 1Mb qlimit 150 \
#	queue {lenke,wmw,http}
#	queue lenke bandwidth 50% priority 3 qlimit 150 cbq(default red)
#    #queue http bandwidth 20% priority 2 cbq (borrow)
#  	queue wmw bandwidth 50% priority 1 qlimit 150 cbq(red)
#  
#nat on sis0 from rl0:network to any -> sis0       # 189.16.21.140

altq on $ext_if bandwidth 1000Kb hfsc queue { lenke, wmw }
   queue lenke bandwidth  50% priority 3 qlimit 500 hfsc (default)
   queue wmw bandwidth 50% priority 2 qlimit 500 hfsc #(realtime 40%)


####FILTRAGEM
#pass in quick on rl1 from 189.16.21.160 to any tag WMW queue wmw
pass in quick on rl1 to any tag WMW queue wmw
pass out quick on sis0 tagged WMW queue wmw
#pass in quick on sis0 from any to 189.16.21.160 tag WMW queue wmw
pass in quick on sis0 from any tag WMW queue wmw
pass out quick on rl1 tagged WMW queue wmw

pass in quick on rl0 from 189.16.21.130 to any tag LENKE queue lenke
pass out quick on sis0 tagged LENKE queue lenke
pass in quick on sis0 from any to 189.16.21.130 tag LENKE queue lenke
pass out quick on rl0 tagged LENKE queue lenke
#pass out quick on $lenke inet proto tcp from  port 80 to $ext_if keep state queue (http)

is ok ?
how to test this ?
 
Thanks for all.

Code:
queue  lenke on sis0 bandwidth 500Kb priority 3 qlimit 500 hfsc( default )
  [ pkts:        289  bytes:      54037  dropped pkts:      0 bytes:      0 ]
  [ qlength:   0/500 ]
  [ measured:     8.0 packets/s, 12.16Kb/s ]
queue  wmw on sis0 bandwidth 500Kb qlimit 500
  [ pkts:       2514  bytes:     219266  dropped pkts:      0 bytes:      0 ]
  [ qlength:   0/500 ]
  [ measured:    67.5 packets/s, 46.86Kb/s ]

What signific this statistics ?
 
Seems rather self-explanatory ... what don't you understand about it?
 
sorry,

in this case, the speed of interfacew wmw is faster then interface lenke ?

I need lenke have always all bandwith not used and at least 50%
wmw interface at most 50%
 
The statistics only indicate how the queues are being used. The 'pkts' and the 'bytes' counters show how much traffic has been handled by the queues, and the 'packets/s' and 'Kb/s' counters show how much traffic is passing these queues right now. Since both queues are nowhere near full, this will not 'prove' that they will both share the 1Mbit/sec link. If you keep [cmd=]pfctl -sq -vv[/cmd] running for some time, you will see the first two counters rise, and the last two counters will show the current bandwidth usage. When there's a lot of traffic, you should see neither of these queues rise over 500 Kbit/sec. When a queue is full, you will see packets being dropped once there are more than 500 packets waiting to be processed.
 
[cmd=]netstat -I sis0 1[/cmd] gives you bandwidth comsumption every second. Replace sis0 with rl0 or rl1 for the other interfaces.
 
Im comparing traffic in rl0 rl1 and sis0
and the sum of values not equal sis0...

is another way, or tool to easy compare traffic ?
 
Thanks a lot again.

I Haved install cacti, butt show this message when i try to access:

FATAL: Cannot connect to MySQL server on 'localhost'. Please make sure you have specified a valid MySQL database name in 'include/config.php'

the file include/config.php not exists :S
 
Back
Top