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

Network topology instance 11: static routing for primary and backup backup

2020-12-07 12:36:36 Nankong City

Networking graph

    

Introduction to static routing

  • Static route is a special route that needs to be manually configured by the administrator . 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 update automatically , You have to manually reconfigure . Static routes have 5 Main parameters : Destination address and mask 、 Interface and next jump 、 priority .
  • The advantage of using static routing is simple configuration 、 High controllability , When the network structure is simple , Just configure static routing to make the network work . In a complex network environment , You can also improve network performance by configuring static routes , And it can guarantee bandwidth for important applications .

Networking requirements

  • Pictured 1 Shown ,PC1 and PC2 adopt 4 platform Switch Connected to a , You can see from the topological diagram that , Data from PC1 To PC2 There are two ways to get to , Namely PC1-SwitchA-SwitchB-SwitchC-PC2 and PC1-SwitchA-SwitchD-SwitchC-PC2, Users want to request from PC1 To PC2 The data stream realizes the primary and backup 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 static routing of data flow back and forth in two directions .
  • 3. Configure... On each host IP Address and default gateway .

Operation steps

  • 1. Configure the interfaces VLAN

  # To configure SwitchA.SwitchB、SwitchC and SwitchD Configuration and SwitchA similar , I won't repeat .

<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 , I won't repeat .

[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 The static route to the destination

  # To configure SwitchA, Configure two static routes with different priorities , The next jump points to SwitchB and SwitchD, Realize 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, Realize 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 The address is 10.1.1.2/24, The default gateway is 10.1.1.1; Configure the host PC2 Of IP The address is 10.1.2.2/24, The default gateway is 10.1.2.1.

  • 6. Verify configuration results

  # see 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

   # see 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 10.1.2.0/24 This segment has only one active route , Under normal circumstances, the link is from PC1 Sent to PC2 The data flow will take precedence and go through SwitchB This path of . from SwitchA Of IP The routing table details show that , arrive 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 is in fault state 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 .

 

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