当前位置:网站首页>Network topology example 11: static routing for primary backup

Network topology example 11: static routing for primary backup

2020-12-07 16:10:01 itread01

Networking graphics

    

Introduction to static routing

  • Static routing is a special route that needs to be manually configured by administrators . Static routing uses less bandwidth than dynamic routing , And it doesn't take up CPU Resources to calculate and update routes . But when the network fails or the topology changes , Static routes do not automatically update , You have to manually reconfigure . Static routing has 5 The main arguments : Destination address and mask 、 Out of the interface and the next hop 、 Priorities .
  • The advantage of using static routing is that it is easy to configure 、 High controllability , When the network structure is simple , Just configure static routing to make the network work properly . In a complex network environment , You can also improve network performance by configuring static routing , And it can guarantee bandwidth for important applications .

Networking requirements

  • As shown in the picture 1 Shown ,PC1 and PC2 Through 4 Taiwan Switch To connect , It can be seen from the topological diagram that , Information from PC1 To PC2 There are two paths to , The difference is PC1-SwitchA-SwitchB-SwitchC-PC2 and PC1-SwitchA-SwitchD-SwitchC-PC2, The user wishes to request from PC1 To PC2 Data stream to achieve primary backup , That is, priority should be given to passing by SwitchB This path of , When this path fails, the traffic automatically switches to pass through SwitchD This path of .

Configuration ideas

  • 1. establish VLAN And configure the interfaces VLAN, Configure each VLANIF Interface IP Address .
  • 2. Configure the static routing of the data flow in both directions .
  • 3. Configure on each host IP Address and preset gateway .

Operation steps

  • 1. Configure which interfaces belong to VLAN

  # To configure SwitchA.SwitchB、SwitchC and SwitchD Configuration and SwitchA Similar , No more details .

<HUAWEI> system-view
[HUAWEI] sysname SwitchA
[SwitchA] vlan batch 10 100 400
[SwitchA] interface gigabitethernet 0/0/1
[SwitchA-GigabitEthernet0/0/1] port link-type access
[SwitchA-GigabitEthernet0/0/1] port default vlan 10
[SwitchA-GigabitEthernet0/0/1] quit
[SwitchA] interface gigabitethernet 0/0/2
[SwitchA-GigabitEthernet0/0/2] port link-type trunk
[SwitchA-GigabitEthernet0/0/2] port trunk allow-pass vlan 100
[SwitchA-GigabitEthernet0/0/2] quit
[SwitchA] interface gigabitethernet 0/0/3
[SwitchA-GigabitEthernet0/0/3] port link-type trunk
[SwitchA-GigabitEthernet0/0/3] port trunk allow-pass vlan 400
[SwitchA-GigabitEthernet0/0/3] quit
  •  2. Configure each VLANIF Interface IP Address

  # To configure SwitchA.SwitchB、SwitchC and SwitchD Configuration and SwitchA Similar , No more details .

[SwitchA] interface vlanif 10
[SwitchA-Vlanif10] ip address 10.1.1.1 24
[SwitchA-Vlanif10] quit
[SwitchA] interface vlanif 100
[SwitchA-Vlanif100] ip address 192.168.12.1 24
[SwitchA-Vlanif100] quit
[SwitchA] interface vlanif 400
[SwitchA-Vlanif400] ip address 192.168.14.1 24
[SwitchA-Vlanif400] quit
  •  3. To configure PC1–PC2 Static routing to the destination of

  # To configure SwitchA, Configure two static routes with different priorities , The next jump points to SwitchB and SwitchD, To achieve the priority of data flow to SwitchB, Go and go SwitchB When the link fails, the traffic automatically switches to SwitchD.

[SwitchA] ip route-static 10.1.2.0 24 192.168.12.2
[SwitchA] ip route-static 10.1.2.0 24 192.168.14.2 preference 70

   # To configure SwitchB.

[SwitchB] ip route-static 10.1.2.0 24 192.168.23.2

   # To configure SwitchD.

[SwitchD] ip route-static 10.1.2.0 24 192.168.34.1
  •  4. To configure PC1–PC2 Static routing of backhaul , It should be noted that the paths of data flow back and forth are consistent .

  # To configure SwitchC, Configure two static routes with different priorities , The next jump points to SwitchB and SwitchD, To achieve the priority of data flow to SwitchB, Go and go SwitchB When the link fails, the traffic automatically switches to SwitchD.

[SwitchC] ip route-static 10.1.1.0 24 192.168.23.1
[SwitchC] ip route-static 10.1.1.0 24 192.168.34.2 preference 70

   # To configure SwitchB.

[SwitchB] ip route-static 10.1.1.0 24 192.168.12.1

   # To configure SwitchD.

[SwitchD] ip route-static 10.1.1.0 24 192.168.14.1
  •  5. Configure the host

   Configure the host PC1 Of IP Address: 10.1.1.2/24, The preset gateway is 10.1.1.1; Configure the host PC2 Of IP Address: 10.1.2.2/24, The preset gateway is 10.1.2.1.

  • 6. Verify configuration results

  # Look at SwitchA Of IP Routing table .

[SwitchA] display ip routing-table
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Tables: Public
         Destinations : 9        Routes : 9        

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  Static  60   0          RD   192.168.12.2    Vlanif100
      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
   192.168.12.0/24  Direct  0    0           D   192.168.12.1    Vlanif100
   192.168.12.1/32  Direct  0    0           D   127.0.0.1       Vlanif100
   192.168.14.0/24  Direct  0    0           D   192.168.14.1    Vlanif400
   192.168.14.1/32  Direct  0    0           D   127.0.0.1       Vlanif400

   # Look at SwitchA Of IP Routing table details .

[SwitchA] display ip routing-table 10.1.2.0 24 verbose
Route Flags: R - relay, D - download to fib
------------------------------------------------------------------------------
Routing Table : Public
Summary Count : 2

Destination: 10.1.2.0/24
     Protocol: Static          Process ID: 0
   Preference: 60                    Cost: 0
      NextHop: 192.168.12.2     Neighbour: 0.0.0.0
        State: Active Adv Relied      Age: 00h13m13s
          Tag: 0                 Priority: medium
        Label: NULL               QoSInfo: 0x0
   IndirectID: 0x80000001       
 RelayNextHop: 0.0.0.0          Interface: Vlanif100
     TunnelID: 0x0                  Flags: RD

Destination: 10.1.2.0/24
     Protocol: Static          Process ID: 0
   Preference: 70                    Cost: 0
      NextHop: 192.168.14.2     Neighbour: 0.0.0.0
        State: Inactive Adv Relied    Age: 00h00m45s
          Tag: 0                 Priority: medium
        Label: NULL               QoSInfo: 0x0
   IndirectID: 0x80000002       
 RelayNextHop: 0.0.0.0          Interface: Vlanif400
     TunnelID: 0x0                  Flags: R

    From SwitchA Of IP You can see in the routing table , Arrive at 10.1.2.0/24 This segment has only one active route , Under normal circumstances, the link is from PC1 To PC2 The data flow will be calculated first and then go through SwitchB This path of . From SwitchA Of IP The routing table details show that , Arrive at 10.1.2.0/24 This segment has a status of Active The routing , There's another one with the status of Inactive The routing , When the primary link fails, the status is Inactive The route will be back in effect , In this way, the traffic can be switched to pass through SwitchD On this path of . In this way, the primary and backup routing can be realized through static routing .

&n

版权声明
本文为[itread01]所创,转载请带上原文链接,感谢
https://chowdera.com/2020/12/20201207160712788v.html