Manual:Bonding Examples: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
==Bonding two VPLS interfaces==
== Bonding EoIP tunnels over two wireless links ==
 
This example extends [[Transparently_Bridge_two_Networks_using_MPLS | Transparent Bridge using MPLS example]]. Mentioned example is using LDP signaled VPLS tunnel which is not suitable for two VPLS tunnels to the same device.
Before continuing with the setup, basic knowledge of [[M:Routing/BGP | BGP]] and [[M:BGP_based_VPLS | BGP signaled VPLS]] is needed.
 
===Network Diagram===
 
[[File:vpls-bonding.png]]
 
There are two wireless links on router and LAN segment is connected to the ethernet side of each router.
 
===Configuration===
 
Lets consider that wireless interfaces are already configured and links are established so that we can start with IP and MPLS configuration.
====IP addressing and MPLS====
 
'''R1'''
<pre>
/interface bridge
add name=lo
/ip address
add address=192.168.222.1/24 interface=wlan1
add address=192.168.223.1/24 interface=wlan2
add address=222.222.222.1/32 interface=lo
 
/ip route
add dst-address=222.222.222.2/32 gateway=192.168.222.2
 
/mpls ldp
set enabled=yes lsr-id=222.222.222.1 transport-address=222.222.222.1
/mpls ldp interface
add interface=wlan1
add interface=wlan2
</pre>
 
'''R2'''
<pre>
/interface bridge
add name=lo
/ip address
add address=192.168.222.2/24 interface=wlan1
add address=192.168.223.2/24 interface=wlan2
add address=222.222.222.2/32 interface=lo
 
/ip route
add dst-address=222.222.222.1/32 gateway=192.168.222.1
 
/mpls ldp
set enabled=yes lsr-id=222.222.222.2 transport-address=222.222.222.2
/mpls ldp interface
add interface=wlan1
add interface=wlan2
</pre>
 
At this point ensure that LDP is running:
 
<pre>
[admin@R1] /mpls ldp neighbor> print
Flags: X - disabled, D - dynamic, O - operational, T - sending-targeted-hello,
V - vpls
#      TRANSPORT      LOCAL-TRANSPORT PEER                      SEN
0 DO  222.222.222.2  222.222.222.1  192.168.222.2:0            no
</pre>
 
===BGP signaled VPLS===
 
We will need two BGP instances one for each VPLS tunnel:
 
'''R1'''
<pre>
/routing bgp instance
add name=bgp1 as=65531
add name=bgp2 as=65532
 
/routing bgp peer
add name=peer1 remote-address-192.168.222.2 remote-as=65530 instance=bgp1 address-families=l2vpn
add name=peer2 remote-address-192.168.223.2 remote-as=65531 instance=bgp2 address-families=l2vpn
</pre>
 
 
'''R2'''
<pre>
/routing bgp instance
add name=bgp1 as=65531
add name=bgp2 as=65532
 
/routing bgp peer
add name=peer1 remote-address-192.168.222.1 remote-as=65530 instance=bgp1 address-families=l2vpn
add name=peer2 remote-address-192.168.223.1 remote-as=65531 instance=bgp2 address-families=l2vpn
</pre>
 
BGP should be running and we can start VPLS configuration. Each of VPLS tunnels will have unique route distinguisher and route target:
 
'''R1'''
<pre>
/interface vpls bgp-vpls
add export-route-targets=222:222 import-route-targets=222:222 name=bgp-vpls1 \
  route-distinguisher=222:222 site-id=1
add export-route-targets=223:223 import-route-targets=223:223 name=bgp-vpls2 \
  route-distinguisher=223:223 site-id=1
</pre>
 
'''R2'''
<pre>
/interface vpls bgp-vpls
add export-route-targets=222:222 import-route-targets=222:222 name=bgp-vpls1 \
  route-distinguisher=222:222 site-id=2
add export-route-targets=223:223 import-route-targets=223:223 name=bgp-vpls2 \
  route-distinguisher=223:223 site-id=2
</pre>
 
At this point both VPLS tunnels are signaled to both BGP peers. It means that VPLS tunnels is established over the one link (which update gets first).
 
To force other VPLS tunnel over another link we will use routign filters to filter out unnecessary updates:
 
'''R1''' and '''R1'''
<pre>
/routing bgp peer
set peer1 out-filter=bgp-out1
set peer2 out-filter=bgp-out2
 
/routing filter
add action=discard chain=bgp-out1 route-targets=223:223
add action=discard chain=bgp-out2 route-targets=222:222
 
</pre>
 
'''Result'''
<pre>
[admin@R1] /interface vpls> print
Flags: X - disabled, R - running, D - dynamic,
B - bgp-signaled, C - cisco-bgp-signaled
...
2 RDB name="vpls3" mtu=1500 l2mtu=1500 mac-address=02:A1:29:95:20:3B arp=enabled
      disable-running-check=no remote-peer=192.168.223.2 cisco-style=no
      cisco-style-id=0 advertised-l2mtu=1500 pw-type=raw-ethernet
      vpls=bgp-vpls2
 
3 RDB name="vpls4" mtu=1500 l2mtu=1500 mac-address=02:A4:61:69:82:F1 arp=enabled
      disable-running-check=no remote-peer=192.168.222.2 cisco-style=no
      cisco-style-id=0 advertised-l2mtu=1500 pw-type=raw-ethernet
      vpls=bgp-vpls1
</pre>
 
===Bonding===
Bonding itself is quite simple
<pre>
/interface bonding add name=bonding1 slaves=vpls3,vpls4
 
/interface bridge
add name=vpn protocol-mode=rstp
/interface bridge ports
add bridge=vpn interface=ether1
add bridge=vpn interface=bonding1
</pre>
 
<pre>
[admin@R1] /interface bonding> print
Flags: X - disabled, R - running
0  R name="bonding1" mtu=1500 mac-address=02:A1:29:95:20:3B arp=enabled
      slaves=vpls3,vpls4 mode=balance-rr primary=none link-monitoring=none
      arp-interval=100ms mii-interval=100ms down-delay=0ms up-delay=0ms
      lacp-rate=30secs transmit-hash-policy=layer-2
</pre>
 
{{Note| As in this example VPLS tunnels are dynamically created, it means that if for some reason one VPLS goes down, bonding slave will become invalid. In this case some script is required which checks VPLS interface updates}}
 
 
== ARP Link Monitoring HowTo ==
 
===About===


This is an example of aggregating multiple network interfaces into a single pipe. In particular, it is shown how to aggregate multiple virtual (EoIP) interfaces to get maximum throughput (MT) with emphasis on availability.
This is an example of aggregating multiple network interfaces into a single pipe. In particular, it is shown how to aggregate multiple virtual (EoIP) interfaces to get maximum throughput (MT) with emphasis on availability.
===Objective===
You will learn how to connect remote locations via multiple physical links. The combined pipe will deliver higher throughput and availability then the individual links.


===Network Diagram===
===Network Diagram===
Line 197: Line 22:


The second step is to add bonding interface and specify EoIP interfaces as slaves:
The second step is to add bonding interface and specify EoIP interfaces as slaves:
* on router R1:
* R1:
<pre>[admin@MikroTik] > / interface bonding add slaves=eoip-tunnel1,eoip-tunnel2 mode=balance-rr  
<pre>[admin@MikroTik] > / interface bonding add slaves=eoip-tunnel1,eoip-tunnel2 mode=balance-rr  
</pre>
</pre>
Refer to the [[MUM 2006 USA/Bonding |following page]] regarding bonding mode selection.
* R2
* and on router R2
<pre>[admin@MikroTik] > / interface bonding add slaves=eoip-tunnel1,eoip-tunnel2 mode=balance-rr  
<pre>[admin@MikroTik] > / interface bonding add slaves=eoip-tunnel1,eoip-tunnel2 mode=balance-rr  
</pre>
</pre>
Line 207: Line 31:
The last step is to add IP addresses to the bonding interfaces:
The last step is to add IP addresses to the bonding interfaces:


* on router R1:
* R1:
<pre>[admin@MikroTik] > / ip address add address 192.168.0.1/24 interface=bonding1
<pre>[admin@MikroTik] > / ip address add address 192.168.0.1/24 interface=bonding1
</pre>
</pre>
Tip: Refer to the [[MUM 2006 USA/Bonding |following page]] regarding bonding mode selection.
* R2
* and on router R2
<pre>[admin@MikroTik] > / ip address add address 192.168.0.2/24 interface=bonding1  
<pre>[admin@MikroTik] > / ip address add address 192.168.0.2/24 interface=bonding1  
</pre>
</pre>
Line 218: Line 41:


Now two routers are able to reach each other using addresses from the 192.168.0.0/24 network. To verify bonding interface functionality, do the following:
Now two routers are able to reach each other using addresses from the 192.168.0.0/24 network. To verify bonding interface functionality, do the following:
* on router R1:
* R1:
<pre>[admin@MikroTik] > /interface monitor-traffic eoip-tunnel1,eoip-tunnel2
<pre>[admin@MikroTik] > /interface monitor-traffic eoip-tunnel1,eoip-tunnel2
</pre>
</pre>
* and on router R2
* R2
<pre>[admin@MikroTik] > /tool bandwidth-test 192.168.0.1 direction=transmit
<pre>[admin@MikroTik] > /tool bandwidth-test 192.168.0.1 direction=transmit
</pre>
</pre>
Line 254: Line 77:
===Link Monitoring===
===Link Monitoring===


It is easy to notice that with the configuration above as soon as any of individual link fails, the bonding interface throughput collapses. That's because no link monitoring is performed, consequently, the bonding driver is unaware of problems with the underlying links. Enabling link monitoring is a must in most bonding configurations. To enable ARP link monitoring (recommended), do the following:
It is easy to notice that with the configuration above as soon as any of individual link fails, the bonding interface throughput collapses. That's because no link monitoring is performed, consequently, the bonding driver is unaware of problems with the underlying links. Enabling link monitoring is a must in most bonding configurations. To enable ARP link monitoring, do the following:


* on router R1:
* R1:
<pre>[admin@MikroTik] > / interface bonding set bonding1 link-monitoring=arp arp-ip-targets=192.168.0.2
<pre>[admin@MikroTik] > / interface bonding set bonding1 link-monitoring=arp arp-ip-targets=192.168.0.2
</pre>
</pre>
Refer to the [[MUM 2006 USA/Bonding |following page]] regarding bonding mode selection.
 
* and on router R2
* R2
<pre>[admin@MikroTik] > / interface bonding set bonding1 link-monitoring=arp arp-ip-targets=192.168.0.1
<pre>[admin@MikroTik] > / interface bonding set bonding1 link-monitoring=arp arp-ip-targets=192.168.0.1
</pre>
</pre>
Tip: Refer to the [[MUM 2006 USA/Bonding |following page]] for information about different link monitoring types.


=== See also ===


*[[Bonding]]
== See also ==
 
* [[M:Interface/Bonding | Bonding]]


[[Category:Interface]]
[[Category:Interface]]
[[Category:Manual]]
[[Category:Manual]]
[[Category:Examples]]
[[Category:Examples]]

Latest revision as of 12:22, 14 August 2017

Bonding EoIP tunnels over two wireless links

This is an example of aggregating multiple network interfaces into a single pipe. In particular, it is shown how to aggregate multiple virtual (EoIP) interfaces to get maximum throughput (MT) with emphasis on availability.

Network Diagram

Two routers R1 and R2 are interconnected via multihop wireless links. Wireless interfaces on both sides have assigned IP addresses.

File:Bonding ARP Monitoring Exam.jpg

Getting started

Bonding could be used only on OSI layer 2 (Ethernet level) connections. Thus we need to create EoIP interfaces on each of the wireless links. This is done as follows:

  • on router R1:
[admin@MikroTik] > /interface eoip add remote-address=10.0.1.1/24 tunnel-id=1
[admin@MikroTik] > /interface eoip add remote-address=10.0.2.1/24 tunnel-id=2
  • and on router R2
[admin@MikroTik] > /interface eoip add remote-address=10.1.1.1/24 tunnel-id=1
[admin@MikroTik] > /interface eoip add remote-address=10.2.2.1/24 tunnel-id=2

The second step is to add bonding interface and specify EoIP interfaces as slaves:

  • R1:
[admin@MikroTik] > / interface bonding add slaves=eoip-tunnel1,eoip-tunnel2 mode=balance-rr 
  • R2
[admin@MikroTik] > / interface bonding add slaves=eoip-tunnel1,eoip-tunnel2 mode=balance-rr 

The last step is to add IP addresses to the bonding interfaces:

  • R1:
[admin@MikroTik] > / ip address add address 192.168.0.1/24 interface=bonding1
  • R2
[admin@MikroTik] > / ip address add address 192.168.0.2/24 interface=bonding1 

Test the configuration

Now two routers are able to reach each other using addresses from the 192.168.0.0/24 network. To verify bonding interface functionality, do the following:

  • R1:
[admin@MikroTik] > /interface monitor-traffic eoip-tunnel1,eoip-tunnel2
  • R2
[admin@MikroTik] > /tool bandwidth-test 192.168.0.1 direction=transmit

You should see that traffic is distributed equally across both EoIP interfaces:

[admin@MikroTik] > /int monitor-traffic eoip-tunnel1,eoip-tunnel2              
    received-packets-per-second: 685      685                                  
       received-bits-per-second: 8.0Mbps  8.0Mbps                              
        sent-packets-per-second: 21       20                                   
           sent-bits-per-second: 11.9kbps 11.0kbps                             
    received-packets-per-second: 898      899                                  
       received-bits-per-second: 10.6Mbps 10.6Mbps                             
        sent-packets-per-second: 20       21                                   
           sent-bits-per-second: 11.0kbps 11.9kbps                             
    received-packets-per-second: 975      975                                  
       received-bits-per-second: 11.5Mbps 11.5Mbps                             
        sent-packets-per-second: 22       22                                   
           sent-bits-per-second: 12.4kbps 12.3kbps                             
    received-packets-per-second: 980      980                                  
       received-bits-per-second: 11.6Mbps 11.6Mbps                             
        sent-packets-per-second: 21       21                                   
           sent-bits-per-second: 11.9kbps 11.8kbps                             
    received-packets-per-second: 977      977                                  
       received-bits-per-second: 11.6Mbps 11.5Mbps                             
        sent-packets-per-second: 21       21                                   
           sent-bits-per-second: 11.9kbps 11.8kbps                             
-- [Q quit|D dump|C-z pause]
[admin@MikroTik] >

Link Monitoring

It is easy to notice that with the configuration above as soon as any of individual link fails, the bonding interface throughput collapses. That's because no link monitoring is performed, consequently, the bonding driver is unaware of problems with the underlying links. Enabling link monitoring is a must in most bonding configurations. To enable ARP link monitoring, do the following:

  • R1:
[admin@MikroTik] > / interface bonding set bonding1 link-monitoring=arp arp-ip-targets=192.168.0.2
  • R2
[admin@MikroTik] > / interface bonding set bonding1 link-monitoring=arp arp-ip-targets=192.168.0.1


See also