Summary of test points for router configuration for software network engineers

  • DHCP server configuration (★★★)
  • Static routing configuration (★★★)
  • Dynamic routing configuration (★★★)

1. Configuration of DHCP server

Acting as a DHCP server is an important function of the router. Common configuration commands

[HUAWEI]dhcp enable  //Enable router DHCP function globally

[HUAWEI]ip pool  pool1  //Create global address pool pool1

[HUAWEI-ip-pool-pool1]network 192.168.3.0 mask 255.255.255.0

//Configure the IP address range of the global address pool

[HUAWEI-ip-pool-pool1]gateway-list 192.168.3.1

//Configure the gateway IP automatically assigned to the DHCP client

[HUAWEI-ip-pool-pool1]dns-list 192.168.3.2

//Configure the DNS address automatically assigned to the DHCP client

[HUAWEI-ip-pool-pool1]excluded-ip-address 192.168.3.2

//Configure unallocated IP

[HUAWEI-ip-pool-pool1]lease day 1 hour 10

//Configure lease information (default for Huawei routers is 1 day)

[HUAWEI-ip-pool-pool1]static-bind ip-address IP address mac-address physical address

//Static IP address binding (in global mode)

[HUAWEI-Gigabitethernet 0/0/1]dhcp select global

//Enable the interface to use the DHCP server function of the global address pool

[DHCP-Server-Vlanif10]dhcp server static-bind ip-address ip address mac-address physical address

//Static IP address binding (in port mode)

DHCP relay related configuration

[HUAWEI-Gigabitethernet 0/0/1]dhcp select relay

[HUAWEI-Gigabitethernet 0/0/1]dehcp relay server-ip  ip address

//Enable the relay service on the interface and configure the IP of the DHCP server connected to the DHCP relay

Note: To distinguish whether the interface is enabled or globally, dhcp select interface in the interface view

2. Static routing configuration

Review the basics of routing technology

  • To know the destination address
  • There are resources to learn routing
  • There is a path to the network that is reachable
  • Have the best choice among many paths
  • Manage and maintain routing information
  • Default priority 60

Configure static routing on router R1:

[R1]ip route-static 129.1.0.0 255.255.0.0 10.0.0.2

[R1]ip route-static 129.1.0.0 16 10.0.0.2

[R1]ip route-static 129.1.0.0 16 s0

(The above three commands are all equivalent, this device’s outgoing interface|next hop IP address)

Configure static routing (default route) on router R2:

[R2]ip route-static 0.0.0.0 0.0.0.0 10.0.0.1

<R2>display ip routing-table //View routing table

Note: The configuration command for host routing is 129.1.0.1 255.255.255.255

floating static route

  • When there are routing entries for the same destination network in the routing table, the request will be forwarded to the corresponding port based on the priority of the routing entries.
  • Link redundancy (functions as route backup)

ip route-static 192.168.1.0 255.255.255.0 192.168.2.1

ip route-static 192.168.1.0 255.255.255.0 192.168.20.1 preference 62

//If preference is not configured, the two commands are equivalent and can be load balanced. The default priority is 60.

3. Dynamic routing configuration

  • RIP routing (★★★)
  • OSPF routing (★★★)
  • BGP routing (★★★)
  • Others (★★★)

Classification of routing protocols

Autonomous system (AS): RIP, OSPF, etc.

External Gateway Protocol: BGP

  • Distance vector routing protocols: RIP, IGRP (suitable for small networks)
  • Link state routing protocols: OSPF, IS-IS
  • Balanced Hybrid Routing Protocol: EIGRP (Cisco Proprietary)
  • Border Gateway Protocol: BGP

Basic concepts of routing

  • neighbor relationship
  • Priority ( default for Huawei routing protocol ) :
direct connection OSPF IS-IS static RIP BGP
0 10 15 60 100 255
  • Metrics : Comparisons for the same routing protocol

Note: If there are multiple routing protocols on the router at the same time, the priorities will be compared.

4. Distance Vector Routing Protocol-RIP

The UDP protocol is used to transmit messages at the transport layer, port 520

Features:

  • Only exchange information with neighboring routers
  • The information exchanged is all the information currently known by this router.
  • Slow down routing information at fixed intervals, default 30 seconds

working principle

  • Send the entire routing table to neighbor routers every 30 seconds .
  • Use hop count as the only metric to select the best route based on hop count
  • The maximum number of hops is 15 hops , and 16 hops means it is unreachable.
  • After a series of routing updates, each router in the network has a complete routing table, which is called convergence.

The router's routing table initially only has direct routes.

How RIP solves routing loops:

  • Maximum metric value: The maximum hop count is set to 16
  • Split horizon: The route learned by the router from a certain interface will not be sent back to neighbor routes from this interface.
  • Route poisoning: When routing information becomes invalid in the routing table, the metric value of the information is set to 16 and then broadcasted.
  • Reverse poisoning (toxicity reversal):
  • Hold time: Set a timer. When the routing entry is invalid,
  • Trigger update: if the port changes, update immediately

RIP timer:

  • Route update time 30S
  • Route invalid time 180S
  • Keep timer 180S
  • Route cleanup time 240S

RIP version

  • RIPv1: Only supports classed routing, automatically summarizes routing information, and broadcasts routing information; (more prone to routing loops and other failures)
  • RIPv2: Supports variable-length subnet mask and CIDR, supports classless routing, and can turn off the automatic summary function. Advertise routing information with multicast address 224.0.0.9

RIP protocol configuration (Huawei)

<R1>system-view

[R1]rip  //Enter RIP view, process 1 is enabled by default

[R1-rip-1]version 2  //Configure RIP version 2

[R1-rip-1]undo summary  //Cancel route aggregation function

[R1-rip-1]network 192.168.1.0  //Declare the directly connected network segment 192.168.1.0

[R1-rip-1]network 192.168.10.0  //Declare the directly connected network segment 192.168.10.0

[R1-rip-1]network 192.168.12.0  //Declare the directly connected network segment 192.168.12.0

[R1-rip-1]quit

You can view routing table information through display

RIP and BFD linkage

BFD: Bidirectional forwarding detection can provide a rapid detection mechanism for link communication failures and notify upper-layer applications immediately. BFD can be associated with multiple routing protocols to achieve rapid route convergence, thereby reducing traffic loss caused by topology changes.

BFD configuration command:

[R1]bfd  //Enable BFD globally and enter the BFD view

[R1-bfd]quit

[R1]rip 1

[R1-rip-1]bfd all-interface enable  //Enable BFD function on all interfaces

[R1-rip-1]bfd all-interface min-tx-interval 100 min-rx-interval 100 detect-multpliter 10

//Configure BFD minimum sending and receiving BFD message intervals and detection multiples

RIP other configurations

[R1]interface g0/0/0/

[Interface view]ip address 10.0.0.1 255.255.255.0

[Interface view]rip metricin  //Modify the interface metric value

[Interface view]rip split-horizon  //Horizontal split

[Interface view]rip poison-reserver  //Poison reversal

[Interface view]quit

rip authentication-mode md5  //MD5 authentication

5. Link state routing protocol OSPF

principle

  • SPF algorithm : shortest path algorithm, taking this router as the root and referring to the link state database for calculation
  • Compare RIP

1) Have a deeper understanding of topology

2) Algorithm for calculating routing: open shortest path first

3) Routing update: faster

Link status: Information describing the router interface

Link state database: higher requirements on the memory and processing power of the router

Adopt a hierarchical routing structure: Divide a large network into areas. There must be one main area (backbone area). Other areas are adjacent to the main area. All interactions in other areas need to go through the main area.

Replenish:

OSPF area type (less likely to take the exam)

  • backbone area
  • Non-backbone area: standard area, stub area, complete stub area, non-pure stub area

OSPF working process

1.  Find neighbors

  • Send hello packets periodically (10s) to discover effective neighbors
  • The IP address that uniquely identifies the router in the OSPF area
  • RouterID selection rules
1. Use the route-id command to specify the routerID.
2. Select the IP address with the highest value on the loopback interface of the router.
3. If there is no loopback interface, select the highest IP address among the physical ports.
  • Neighbor routers on point-to-point networks will also establish adjacencies

2.  Establish adjacency relationships

3.  Link status information transmission

4.  Calculate routing

OSPF establishes adjacency relationships-DR and BDR

Routers are interconnected in pairs to form n(n-1)/2 adjacencies.

DR is the designated router, and BDR is the backup of DR.

  • Select DR and BDR to represent the OSPF network segment through Hello messages
  • Other routers (DRothers) only form adjacencies with DR and BDR
  • DR/BDR listens to the multicast address 224.0.0.6 (destination address), and other routers listen to the multicast address 224.0.0.5 (destination address)

Note 1: Neighbors are not equal to adjacencies.

Note 2: HELLO messages are sent through multicast 224.0.0.5

DR and BDR election process

  • First compare the priority (0-255, default 1) and then compare the routeID
  • If the priority is 0, it will not participate in DR and BDR elections.
  • Sending HELLO messages through multicast

 Five grouping types of OSPF

1.  Hello packet: used to establish and maintain adjacency relationships. It is sent every 10 seconds. If no packet is received after 4 times the hello interval, the adjacency is considered expired.

2.  Database description grouping: a simple description (header) corresponding to the link status

3.  Link status request LSR grouping

4.  Link status update LSU grouping

5.  Link status confirmation LSA packet

First send a simple link status to the other party. After comparison, the other party will send an LSR back based on the information it has. Then it will send an LSU to the other party based on the LSR information. After receiving the LSU, the other party will confirm and send back the LSA.

OSPF calculates route-metric value

COST=108/BW (100/bandwidth Mbps)

The shortest path is calculated based on the cost specified by the interface

Interface Type Price (108/BW)
Fast Ethernet 1
Ethernet 10
56K 1785

That is, the greater the bandwidth, the smaller the link overhead.

process:

1. Exchange information with neighboring routers and establish a neighbor list

2. Obtain information from peer routers and build a complete network diagram - a link state database

3. Then based on the case number status database, use [Shortest Path Tree Algorithm SPF/dijkstra Algorithm] to calculate a tree structure with itself as the root, and then generate a routing table

The concept of OSPF area

Area0 (backbone area)

Area border router ABR : used to connect Area0 and other Areas

Internal router : only saves link status information within this area

Autonomous system border router ASBR : used to connect OSPF ASs with other external routes

6. Basic configuration of OSPF (Huawei)

Order illustrate
ospf {process-id} Start the OSPF protocol process and enter the OSPF view. The OSPF process number only works in this router and can be different in different routers.
area area-id Create and enter OSPF area view
network network code address anti-mask Specify the network directly connected to the router in the area view and use anti-mask
display ospf routing View OSPF routing information
display ospf {process-id} peer List the routers that are "neighbors" to this router (that is, exchange routing information).
ospf cost cost Manually set the interface cost value and configure it in the interface view.

Configuration case (handout P264)

R1 configuration:

<R1>system-view

[R1]router-id 1.1.1.1 //Specify the routerID of R1 as 1.1.1.1

[R1]ospf

[R1-ospf-1]area 0

[R1-ospf-1-area-0.0.0.0]network 172.16.10.0 0.0.0.255

[R1-ospf-1-area-0.0.0.0]network 172.16.11.0 0.0.0.255

(Declaring adjacency networks)

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

[R1-ospf-1]area 1

[R1-ospf-1-area-0.0.0.1]network 192.168.2.0 0.0.0.255

7. Intermediate system to intermediate system—IS-IS

concept:

IS-IS is also a link state protocol and an interior gateway protocol (similar to OSPF), which is commonly used by operators (OSPF is commonly used in enterprises)

There can be multiple backbone areas and non-backbone areas

Router classification (just learn about it)

  • level-1 (l1) : non-backbone router (ordinary router)
  • level-2 (l2) : backbone router
  • level-1-2 (l1/2) : similar to the area border router in OSPF, used for connections between areas.

8. Border Gateway Protocol-BGP

Characteristics of BGP protocol

  • It is a routing protocol that implements AS and AS
  • path vector routing protocol
  • Complete information is only exchanged once when BGP is started, and subsequent routing update messages only carry information about network changes.
  • BGP routes also carry path vectors, that is, the AS list (AS-Path) passed through , which can avoid loops.
  • Periodically send Keepalive messages to maintain the connection with the peer
  • There are EBGP (between different ASs) and IBGP (intra-AS).
  • TCP is used at the transport layer , the destination port number is 179, and the source port is a random high-bit port.

9. Route introduction configuration

Introducing OSPF into RIP:

[HUAWEI]rip 1

[HUAWEI-rip-l]import-route ospf 109 cost 10

RIP is introduced in OSPF:

[HUAWEI]ospf 109

[HUAWEI-ospf-109]import-route rip 1 cost 200

The introduction of routes is bidirectional

Introduce static routes: import-router static cost  cost

Default route Default route cannot be imported through import

Default route introduction: default-route-advertise always (just understand it)

10. Virtual Routing Redundancy Protocol VRRP

(Cisco is HSRP)

Configuration is usually implemented on core layer 3 devices

There are multiple routers in the VRRP group: active router and backup router, thus forming a virtual router.

Specify the IP address of the virtual router on the active router and backup router, and the MAC address will be automatically generated.

Active router election:

The election is carried out by priority (default 100). The highest priority is the active router. The priority is 0 and does not participate in the election. The range is 0-255.

Preemption mode: If preemption mode is set, the active router in the VRRP group is always the router with the highest priority.

Basic configuration of VRRP

1. Configure VRRP virtual gateway (virtual IP)

2. Configure VRRP priority

Do the following configuration on the gateway interface

[Interface view] vrrp vrid 10 virtual-ip 192.168.1.254

//Configure VRRP group number 10 and specify the virtual gateway IP

[Interface view]vrrp vrid 10 priority 200  //The priority is 200

[Interface view] vrrp vrid 10 preempt-mode time delay 10

//Configure for delayed preemption mode, delay time 10 seconds

The backup router configuration is similar and has a lower priority than the active router.

In addition, you can also configure VRRP to associate with the uplink interface status:

[Interface view] vrrp vrid 10 track interface gigabitethernet 0/0/2 reduced 60

//Track the g0/0/2 interface in the vrrp group. If the interface is down, reduce the priority of this router by 60

When the uplink interface is down, the priority of the active router is reduced to 140, and the backup router preempts to become the active router to complete the data forwarding work.

Implement load balancing by establishing multiple VRRP groups

11. Communication between VLANs (layer 3 switch)

[HUAWEI]interface vlanif 10

[HUAWEI-vlanif10]ip address 192.168.0.1 255.255.255.0

[HUAWEI]interface vlanif 20

[HUAWEI-vlanif20]ip address 10.10.10.1 255.255.255.0

[HUAWEI]interface vlanif 100

[HUAWEI-vlanif100]ip address 172.16.0.1 255.255.255.0

Communication between VLANs can be achieved by configuring IP addresses (equivalent to directly connected network segments) to the corresponding logical interfaces on Huawei Layer 3 switches.

Guess you like

Origin blog.csdn.net/ducanwang/article/details/133188943