Manual:Bonding Examples: Difference between revisions

From MikroTik Wiki
Jump to navigation Jump to search
Line 91: Line 91:
</pre>
</pre>


BGP should be running and we cans tart VPLS configuration. Each of VPLS tunnels will have unique route distinguisher and route target:
BGP should be running and we can start VPLS configuration. Each of VPLS tunnels will have unique route distinguisher and route target:


'''R1'''
'''R1'''

Revision as of 11:12, 20 September 2010

Bonding two VPLS interfaces

This example extends 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 BGP and BGP signaled VPLS is needed.

Network Diagram

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

/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

R2

/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

At this point ensure that LDP is running:

[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 

BGP signaled VPLS

We will need two BGP instances one for each VPLS tunnel:

R1

/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


R2

/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

BGP should be running and we can start VPLS configuration. Each of VPLS tunnels will have unique route distinguisher and route target:

R1

/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

R2

/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

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

/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

Result

[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 

Bonding

Bonding itself is quite simple

/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
[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 
Icon-note.png

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.

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

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:

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

Refer to the following page regarding bonding mode selection.

  • and on router 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:

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

Tip: Refer to the following page regarding bonding mode selection.

  • and on router 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:

  • on router R1:
[admin@MikroTik] > /interface monitor-traffic eoip-tunnel1,eoip-tunnel2
  • and on router 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 (recommended), do the following:

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

Refer to the following page regarding bonding mode selection.

  • and on router R2
[admin@MikroTik] > / interface bonding set bonding1 link-monitoring=arp arp-ip-targets=192.168.0.1

Tip: Refer to the following page for information about different link monitoring types.

See also