Load balancing configuration example OSPF

Load balancing configuration example OSPF
Micro-channel public number: Network migrant workers

Network Graphics

Load balancing configuration example OSPF

FIG 1 FIG Network load balancing configuring OSPF

OSPF load balancing Introduction

Equivalent load balancing ECMP (Equal-CostMultiple Path), refers to the presence of multiple paths between two network nodes simultaneously, traffic between nodes equally among multiple paths. Load balancing effect is to reduce traffic pressure of each path, and enhance network robustness. When multiple routing protocols discover routes to the same destination in the same reach, and the cost of these routes have the same value, then it is to meet the conditions of load balancing. When the load balancing router forwards according quintuple (source address, destination address, source port, destination port, protocol), when the same five-tuple, a router always choose the same next-hop address to send message. When the five-tuple is not the same, the router will select relatively free path forwarding.

In OSPF network, sometimes there are multiple equal-cost paths between two network elements, and a single path and very difficult to bear all the traffic, then the user is generally desirable multiple paths equally among all of the traffic, so both can improve the reliability of the network, but also improve the utilization of resources, in which case you can consider configuring OSPF load balancing.

Configuration Considerations

· By maximumload-balancing command to configure the maximum number of equal-cost routes for load balancing.

• If you need to cancel load balancing, the maximum number of equal-cost routes can be set to 1.

Network requirements

As shown, OSPF network has four switches 1, belong to the region 0. Load balancing is required, so that the flow SwitchA, SwitchB and SwitchC be respectively supplied SwitchD.

Description:

Make sure this scenario interconnect interface STP is not enabled. Because STP is enabled on the ring network, if constructed with three layers of network switches VLANIF interface, will lead to a port is blocked, resulting in three business can not function properly.

Configuration Roadmap

OSPF configuration follows the idea of ​​load balancing:

  1. OSPF basic functions on each switch, basic OSPF network interworking.

  2. In SwitchA configure load balancing, load balancing purposes.

Steps

  1. Configuring the VLAN interfaces

Configure SwitchA. SwitchB, SwitchC and SwitchD configuration SwitchA similar.

<HUAWEI>system-view

[HUAWEI] sysnameSwitchA

[SwitchA] vlanbatch 10 20 50

[SwitchA]interface gigabitethernet 1/0/1

[SwitchA-GigabitEthernet1/0/1]port link-type trunk

[SwitchA-GigabitEthernet1/0/1]port trunk allow-pass vlan 10

[SwitchA-GigabitEthernet1/0/1]quit

[SwitchA]interface gigabitethernet 1/0/2

[SwitchA-GigabitEthernet1/0/2]port link-type trunk

[SwitchA-GigabitEthernet1/0/2]port trunk allow-pass vlan 20

[SwitchA-GigabitEthernet1/0/2]quit

[SwitchA]interface gigabitethernet 1/0/3

[SwitchA-GigabitEthernet1/0/3]port link-type trunk

[SwitchA-GigabitEthernet1/0/3]port trunk allow-pass vlan 50

[SwitchA-GigabitEthernet1/0/3]quit

  1. Configure the IP address of each VLANIF interface

Configure SwitchA. SwitchB, SwitchC and SwitchD configuration SwitchA similar.

[SwitchA] interfacevlanif 10

[SwitchA-Vlanif10] ipaddress 10.1.1.1 24

[SwitchA-Vlanif10] quit

[SwitchA] interfacevlanif 20

[SwitchA-Vlanif20] ipaddress 10.1.2.1 24

[SwitchA-Vlanif20] quit

[SwitchA] interfacevlanif 50

[SwitchA-Vlanif50] ipaddress 172.16.1.1 24

[SwitchA-Vlanif50] quit

  1. OSPF basic functions

Configure SwitchA.

[SwitchA] ospf 1router-id 10.10.10.1

[SwitchA-ospf-1] area0

[SwitchA-ospf-1-area-0.0.0.0]network 172.16.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255

[SwitchA-ospf-1-area-0.0.0.0]quit

[SwitchA-ospf-1] quit

Configure SwitchB.

[SwitchB] ospf 1router-id 10.10.10.2

[SwitchB-ospf-1] area0

[SwitchB-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.0.255

[SwitchB-ospf-1-area-0.0.0.0]quit

[SwitchB-ospf-1] quit

Configuration SwitchC.

[SwitchC] ospf 1router-id 10.10.10.3

[SwitchC-ospf-1] area0

[SwitchC-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255

[SwitchC-ospf-1-area-0.0.0.0]quit

[SwitchC-ospf-1] quit

Configuration SwitchD.

[SwitchD] ospf 1router-id 10.10.10.4

[SwitchD-ospf-1] area0

[SwitchD-ospf-1-area-0.0.0.0]network 192.168.0.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.0]network 192.168.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.0]network 172.17.1.0 0.0.0.255

[SwitchD-ospf-1-area-0.0.0.0]quit

[SwitchD-ospf-1] quit

View the routing table of SwitchA.

[SwitchA] displayip routing-table

Route Flags: R -relay, D - download to fib


Routing Tables:Public

     Destinations : 11       Routes : 12

Destination/Mask Proto Pre Cost Flags NextHop Interface

   10.1.1.0/24  Direct 0    0           D  10.1.1.1        Vlanif10

   10.1.1.1/32  Direct 0    0           D  127.0.0.1       Vlanif10

   10.1.2.0/24  Direct 0    0           D  10.1.2.1        Vlanif20

   10.1.2.1/32  Direct 0    0           D  127.0.0.1       Vlanif20

  127.0.0.0/8   Direct 0    0           D  127.0.0.1       InLoopBack0

  127.0.0.1/32  Direct 0    0           D  127.0.0.1       InLoopBack0

 172.16.1.0/24  Direct 0    0           D  172.16.1.1      Vlanif50

 172.16.1.1/32  Direct 0    0           D  127.0.0.1       Vlanif50

 172.17.1.0/24  OSPF   10   3           D  10.1.2.2        Vlanif20

                OSPF    10  3           D   10.1.1.2        Vlanif10

192.168.0.0/24  OSPF   10   2           D  10.1.1.2        Vlanif10

192.168.1.0/24  OSPF   10   2           D  10.1.2.2        Vlanif20

As seen from the routing table, the maximum number of equivalent routes for the block switches 16, the maximum number of equivalent routes cassette switch 8, so that the two next-hop SwitchA 10.1.1.2 (SwitchB) and 10.1.2.2 (SwitchC ) have become effective route.

  1. Priority equal-cost routes on SwitchA

If you do not want to load balancing and SwitchC SwitchB, equal-cost routes may be configured to specify the next hop.

[SwitchA] ospf 1

[SwitchA-ospf-1] nexthop10.1.2.2 weight 1 // weight of the routes provided by the equivalent weight parameter priority, the default value is 255, the value is, the higher the priority.

[SwitchA-ospf-1] quit

View the routing table of SwitchA

[SwitchA] displayip routing-table

Route Flags: R -relay, D - download to fib


Routing Tables:Public

     Destinations : 11       Routes : 11

Destination/Mask Proto Pre Cost Flags NextHop Interface

   10.1.1.0/24  Direct 0    0           D  10.1.1.1        Vlanif10

   10.1.1.1/32  Direct 0    0           D  127.0.0.1       Vlanif10

   10.1.2.0/24  Direct 0    0           D  10.1.2.1        Vlanif20

   10.1.2.1/32  Direct 0    0           D  127.0.0.1       Vlanif20

  127.0.0.0/8   Direct 0    0           D  127.0.0.1       InLoopBack0

  127.0.0.1/32  Direct 0    0           D  127.0.0.1       InLoopBack0

 172.16.1.0/24  Direct 0    0           D  172.16.1.1      Vlanif50

 172.16.1.1/32  Direct 0    0           D  127.0.0.1       Vlanif50

 172.17.1.0/24  OSPF   10   3           D  10.1.2.2        Vlanif20

192.168.0.0/24  OSPF   10   2           D  10.1.1.2        Vlanif10

192.168.1.0/24  OSPF   10   2           D  10.1.2.2        Vlanif20

As can be seen from the routing table, when the priority of equal-cost routes, since the next hop 10.1.2.2 (SwitchC) (the weight of 1) higher than the priority of the next hop 10.1.1.2 (SwitchB) the priority, OSPF selects the next hop 10.1.2.2 as the optimal route.

Profiles

· SwitchA profile

#

sysname SwitchA

#

vlan batch 10 20 50

#

interface Vlanif10

ip address 10.1.1.1 255.255.255.0

#

interface Vlanif20

ip address 10.1.2.1 255.255.255.0

#

interface Vlanif50

ip address 172.16.1.1 255.255.255.0

#

interface GigabitEthernet1/0/1

port link-type trunk

port trunk allow-pass vlan 10

#

interface GigabitEthernet1/0/2

port link-type trunk

port trunk allow-pass vlan 20

#

interface GigabitEthernet1/0/3

port link-type trunk

port trunk allow-pass vlan 50

#

ospf 1 router-id10.10.10.1

nexthop 10.1.2.2 weight 1

area 0.0.0.0

network 10.1.1.0 0.0.0.255

network 10.1.2.0 0.0.0.255

network 172.16.1.0 0.0.0.255

#

return

· SwitchB profile

#

sysname SwitchB

#

vlan batch 10 30

#

interface Vlanif10

ip address 10.1.1.2 255.255.255.0

#

interface Vlanif30

ip address 192.168.0.1 255.255.255.0

#

interface GigabitEthernet1/0/1

port link-type trunk

port trunk allow-pass vlan 10

#

interface GigabitEthernet1/0/2

port link-type trunk

port trunk allow-pass vlan 30

#

ospf 1 router-id10.10.10.2

area 0.0.0.0

network 10.1.1.0 0.0.0.255

network 192.168.0.0 0.0.0.255

#

return

· SwitchC profile

#

sysname SwitchC

#

vlan batch 20 40

#

interface Vlanif20

ip address 10.1.2.2 255.255.255.0

#

interface Vlanif40

ip address 192.168.1.1 255.255.255.0

#

interface GigabitEthernet1/0/1

port link-type trunk

port trunk allow-pass vlan 20

#

interface GigabitEthernet1/0/2

port link-type trunk

port trunk allow-pass vlan 40

#

ospf 1 router-id10.10.10.3

area 0.0.0.0

network 10.1.2.0 0.0.0.255

network 192.168.1.0 0.0.0.255

#

return

· SwitchD profile

#

sysname SwitchD

#

vlan batch 30 40 60

#

interface Vlanif30

ip address 192.168.0.2 255.255.255.0

#

interface Vlanif40

ip address 192.168.1.2 255.255.255.0

#

interface Vlanif60

ip address 172.17.1.1 255.255.255.0

#

interface GigabitEthernet1/0/1

port link-type trunk

port trunk allow-pass vlan 30

#

interface GigabitEthernet1/0/2

port link-type trunk

port trunk allow-pass vlan 40

#

interface GigabitEthernet1/0/3

port link-type trunk

port trunk allow-pass vlan 60

#

ospf 1 router-id10.10.10.4

area 0.0.0.0

network 172.17.1.0 0.0.0.255

network 192.168.0.0 0.0.0.255

network 192.168.1.0 0.0.0.255

#

return
Load balancing configuration example OSPF
micro-channel public number: Network migrant workers

Guess you like

Origin blog.51cto.com/jiajunjie/2481561