Community discussions

MikroTik App
 
franrtorres77
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun Mar 31, 2013 9:05 pm

queue for limiting bandwith per IP address

Tue Nov 05, 2013 7:06 pm

Hello I would like to create a queue for controlling the bandwith of a specific ip. It is a webcam which get all the traffic and the other users can't navigate.

I have created a simple queue but it does not work.

My scenario is like this:

sextant---- router 192.168.0.1------ webcam 192.168.0.252

the sextant has a bridge for joining the wireless and the Ethernet parts.

thank you
 
User avatar
boen_robot
Forum Guru
Forum Guru
Posts: 2400
Joined: Thu Aug 31, 2006 4:43 pm
Location: europe://Bulgaria/Plovdiv

Re: queue for limiting bandwith per IP address

Tue Nov 05, 2013 7:34 pm

Simple queues should do the trick...

How does your simple queue look like?
 
franrtorres77
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun Mar 31, 2013 9:05 pm

Re: queue for limiting bandwith per IP address

Tue Nov 05, 2013 9:58 pm

it is very simple, I have attached a picture Image
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: queue for limiting bandwith per IP address

Tue Nov 05, 2013 10:04 pm

In the target field put the IP address you want to limit, and leave the destination field empty.
The destination field is used when you want to limit a particular connection from target IP to that destination IP
http://wiki.mikrotik.com/wiki/Manual:Qu ... properties
 
franrtorres77
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun Mar 31, 2013 9:05 pm

Re: queue for limiting bandwith per IP address

Tue Nov 05, 2013 10:17 pm

thank you, I will try that
 
franrtorres77
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun Mar 31, 2013 9:05 pm

Re: queue for limiting bandwith per IP address

Wed Nov 06, 2013 12:23 am

I have set it like that but the queue is not working yet.Image
 
CelticComms
Forum Guru
Forum Guru
Posts: 1765
Joined: Wed May 02, 2012 5:48 am

Re: queue for limiting bandwith per IP address

Wed Nov 06, 2013 12:48 am

IS your webcam on 192.168.0.252 or 192.168.223.252? Both IPs appear above.
 
franrtorres77
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun Mar 31, 2013 9:05 pm

Re: queue for limiting bandwith per IP address

Wed Nov 06, 2013 12:57 am

in 192.168.223.252 the 0.252 was an error, all the devices are in the 192.168.223.0/32 net.
Sorry
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: queue for limiting bandwith per IP address

Wed Nov 06, 2013 2:14 pm

So, to get this straight. You have a routerboard which is configured as bridge. And this routerboard you are putting a simple queue which should control the bandwidth of a device which is not in its network, right?

Then, try in /ip firewall mangle to mark the packets coming from this device:
/ip firewall mangle
add chain=prerouting src-address=192.168.223.252 action=mark-connection new-connection-mark=IPcam passthrough=yes
add chain=prerouting connection-mark=IPcam action=mark-packet new-packet-mark=IPcam passthrough=no
You should see the counters on these rules running. If they are not counting it means the router is not capturing this traffic. If they are running, then use the packet mark in the simple queue instead of the target ip.

What router do you have before the bridge one? It should be easier to do limitation on that router.
 
franrtorres77
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun Mar 31, 2013 9:05 pm

Re: queue for limiting bandwith per IP address

Thu Nov 07, 2013 9:39 am

Good morning,

I just have a switch between the antenna and the webcam, all these devices are in the same net:

antenna(192.168.223.145)---> switch--> webcam(192.168.223.252)

I have set up the mangle rules and it has only marked 4 packets, but the camera is compsuming 5 or 6mb all the time when you watch it from a remote location.
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: queue for limiting bandwith per IP address

Thu Nov 07, 2013 11:22 am

Please post configs of your antenna. Enter in terminal from winbox and from there copy paste the configs of interfaces, addresses, routes, or just do
/export compact
and paste it in here.
 
franrtorres77
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun Mar 31, 2013 9:05 pm

Re: queue for limiting bandwith per IP address

Fri Nov 08, 2013 11:13 am

Hello, sorry for the delay, here you have the export result:





# jan/04/1970 18:41:59 by RouterOS 6.5
# software id = TAIX-95GB
#
/interface bridge
add l2mtu=1600 name=bridge1 protocol-mode=rstp
/interface ethernet
set [ find default-name=ether1 ] name=ether1-local
/interface wireless security-profiles
set [ find default=yes ] supplicant-identity=MikroTik
add authentication-types=wpa-psk,wpa2-psk eap-methods="" group-ciphers=\
tkip,aes-ccm management-protection=allowed mode=dynamic-keys name=\
profile1 supplicant-identity="" unicast-ciphers=tkip,aes-ccm \
wpa-pre-shared-key=Qaoooz1610774554wpa2-pre-shared-key=Qaoooz1610774554
/interface wireless
set [ find default-name=wlan1 ] band=5ghz-a/n disabled=no frequency=5220 \
ht-rxchains=0,1 ht-txchains=0,1 l2mtu=2290 mode=station-bridge name=\
wlan1-gateway security-profile=profile1 ssid=Ap_ptp_rioNO \
wireless-protocol=nv2
/interface wireless nstreme
set wlan1-gateway enable-nstreme=yes
/ip neighbor discovery
set wlan1-gateway discover=no
/ip dhcp-server
add interface=bridge1 name=dhcp1
/ip hotspot user profile
set [ find default=yes ] idle-timeout=none keepalive-timeout=2m \
mac-cookie-timeout=3d
/ip pool
add name=default-dhcp ranges=192.168.88.10-192.168.88.254
/ip dhcp-server
add address-pool=default-dhcp disabled=no interface=ether1-local name=default
/queue simple
add name=queue1 packet-marks=IPcam target=192.168.223.252/32
/interface bridge port
add bridge=bridge1 interface=ether1-local
add bridge=bridge1 interface=wlan1-gateway
/ip address
add address=192.168.223.145/24 comment="default configuration" interface=\
ether1-local network=192.168.223.0
/ip dhcp-client
add comment="default configuration" dhcp-options=hostname,clientid interface=\
bridge1
/ip dhcp-server network
add address=192.168.88.0/24 comment="default configuration" dns-server=\
192.168.88.1 gateway=192.168.88.1
/ip dns
set allow-remote-requests=yes servers=8.8.8.8
/ip dns static
add address=192.168.88.1 name=router
/ip firewall filter
add chain=input comment="default configuration" protocol=icmp
add chain=input comment="default configuration" connection-state=established
add chain=input comment="default configuration" connection-state=related
add action=drop chain=input comment="default configuration" in-interface=\
wlan1-gateway
add chain=forward comment="default configuration" connection-state=\
established
add chain=forward comment="default configuration" connection-state=related
add action=drop chain=forward comment="default configuration" \
connection-state=invalid
/ip firewall mangle
add action=mark-connection chain=prerouting new-connection-mark=IPcam \
src-address=192.168.223.252
add action=mark-packet chain=prerouting connection-mark=IPcam \
new-packet-mark=IPcam passthrough=no
/ip firewall nat
add action=masquerade chain=srcnat comment="default configuration" disabled=\
yes out-interface=wlan1-gateway to-addresses=0.0.0.0
/system clock
set time-zone-name=Europe/Madrid
/system identity
set name=PlantaGranadaSextant
/system leds
set 0 interface=wlan1-gateway
/system logging
add topics=wireless
add topics=pppoe
/system ntp client
set enabled=yes mode=unicast primary-ntp=81.19.96.148 secondary-ntp=\
46.16.60.129
/system routerboard settings
set cpu-frequency=600MHz
/tool mac-server
set [ find default=yes ] disabled=yes
add interface=ether1-local
/tool mac-server mac-winbox
set [ find default=yes ] disabled=yes
add interface=ether1-local
[admin@PlantaGranadaSextant] >>
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: queue for limiting bandwith per IP address

Fri Nov 08, 2013 12:55 pm

/ip address
add address=192.168.223.145/24 comment="default configuration" interface=\
ether1-local network=192.168.223.0
Assign the ip address on the bridge interface instead of the ether interface
/ip address
add address=192.168.223.145/24 comment="default configuration" interface=\
bridge1 network=192.168.223.0
 
franrtorres77
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun Mar 31, 2013 9:05 pm

Re: queue for limiting bandwith per IP address

Fri Nov 08, 2013 6:15 pm

Hello.

I think I did it ok, but the traffic is working as before.
You do not have the required permissions to view the files attached to this post.
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: queue for limiting bandwith per IP address

Sat Nov 09, 2013 12:23 pm

One last thing, set the bridge to use ip firewall, you can find this option in the settings of bridge.
 
franrtorres77
Frequent Visitor
Frequent Visitor
Topic Author
Posts: 79
Joined: Sun Mar 31, 2013 9:05 pm

Re: queue for limiting bandwith per IP address

Sun Nov 10, 2013 12:57 am

thank you very much, it is woriking perfectly!
 
User avatar
Caci99
Forum Guru
Forum Guru
Posts: 1075
Joined: Wed Feb 21, 2007 2:26 pm
Location: Tirane
Contact:

Re: queue for limiting bandwith per IP address

Sun Nov 10, 2013 2:00 am

uh, i feel releaved, glad it is working. Have fun :)

Who is online

Users browsing this forum: sakistech and 81 guests