How to Build a Transparent Traffic Shaper?
Description
You want to use MikroTik RouterOS? as a transparent Traffic Shaper on an
existing Ethernet network. You can simply plug it between the network and the
existing router. To achieve this, RouterOS? should be configured as follows
(this is written assuming that there is no other configuration on the shaper and
there are two Ethernet cards in it):
-
Enable and name the ethernet interfaces. The interface which is connecter to
the network will be called int, and the one connected to the existing
router - ext: /interface set ether1,ether2 disabled=no
/interface set ether1 name=int
/interface set ether2 name=ext
-
Then let's assume the gateway has the IP address of 10.0.0.1/24. Adding the
address of, for example, 10.0.0.2/24 (you will need this address later to
be able configure the shaper remotely) to this interface, you should be able to
ping the gateway. If it is not happening, then you should swap cables (i.e. plug
the one connected to the ext interface to the int and vice versa).
Note: if neither works, there might be a firewall set up on the gateway,
remove it temporarily and try again. /ip address add interface=ext address=10.0.0.2/24
/ping 10.0.0.1
-
Create a bridge interface which bridges both int and ext
physical interfaces: /interface bridge add name=bridge
/interface bridge port set ext,int bridge=bridge
Note the IP address should be transferred to the bridge
interface: /ip address set [/ip address find] interface=bridge
Now you can simply add the desirable queues. Note that you may use the
names of the real interfaces for these queues. For example, to limit all
download to 256Kbit/s and all upload to 128Kbit/s, it is enough to add two
queues: /queue simple add limit-at=131072 interface=ext
/queue simple add limit-at=262144 interface=int
For more information and examples of how to limit data rate and provide
quality of service, see Bandwidth Control Manual. |