Vro configuration in Linux 3

Source: Internet
Author: User
Article title: vro Configuration 3 in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.
Dynamic Router configuration
  
Basic principles
  
First, explain what dynamic routing is.
  
As described above, the basic function of a router is to find the path to the destination address for the IP Group. In the previous section, we introduced manual and static configuration of routing rules, that is, manual routing. However, the Internet is a huge system, and the network structure running above is responsible, and the topology structure is also changing at any time, in this way, we will not be able to obtain the best path for static configuration in some complex ranges. In addition, once the network structure changes, we often cannot change the manual static configuration in time. In this context, the concept of dynamic routing configuration is introduced, that is, dynamic routers.
  
Route table items on a dynamic router exchange information between the connected routers and are optimized according to certain algorithms. These routing information is constantly updated during a certain period of time, in order to adapt to the changing network, in order to obtain the optimal path seeking effect at any time. To achieve efficient routing for IP groups, IETF has developed multiple routing protocols. The internal gateway Protocol for Autonomous systems (AS: Autonomous System) includes the Open Shortest Path First Protocol and the RIP: Routing Information Protocol ). An autonomous system is a collection of hosts, routers, and other network devices managed by the same entity (such as a school, enterprise, or ISP. There are also external network routing protocol BGP-4 for autonomous domain systems.
  
The software that runs these routing protocols is what we usually call routing software. common routing software in Linux includes gated and zebra ,. The former has both the release of the GPL version and the paid version, while the latter is a completely GPL efficient routing software developed by a Japanese organization. The software gated is usually used by default in Linux releases. The following describes how to configure and use it.
  
Introduction to routing protocols
  
Here we will introduce the RIP protocol.
  
RIP is the abbreviation of Routing Information Protocol, and direct translation is the "Routing Information Protocol ".
  
RIP uses the distance vector algorithm for route computing. Therefore, it is also called the distance vector routing protocol ).
  
RIP is characterized by regular exchange of the overall knowledge of the network between routers, and only exchange this knowledge with adjacent routers. In other words, the router only shares network information with the adjacent router. Once a router obtains new knowledge from an adjacent router, it appends the knowledge to its own database and transmits the information to all adjacent routers. The neighboring routers perform the same operation several times, so that all the routers in the autonomous system can obtain the complete routing information.
  
RIP packets are transmitted using UDP datagram. To distinguish RIPng from other UDP applications, it is required that RIPng's recognized dedicated UDP port number is 521. The source/destination ports of the active route-seeking update packets are RIPng ports, and the responding update packets are sent to the initiating port. It should be noted that the RIP port number in IPv4 is 520, which is different from RIPng.
  
The timer loves RIP and plays an important role. In RIP, three different timers are used to support path-seeking operations.
  
The first is the timer that starts the timed RIP update operation. This timer is usually set to 30 seconds. It is further restricted in the RIP standard. it requires the router to use a random number to send the update message, and select the interval between 25 seconds and 35 seconds for the RIP update message. The purpose is to prevent all routers on the network from sending update packets at the same time, resulting in a conflict when a large amount of traffic is under pressure on the network. The random interval can be used to balance the business volume, thus reducing the router conflict.
  
In order to avoid conflicts, note that the RIP does not reset the 30-second timer at any time when a message is sent in the trigger update. If reset is performed, the interval at which update packets of multiple routers are sent will conflict. This is because all routers start the timer at the same time after sending the trigger update. If the timer is not reset, the scheduled update message is sent without error even if the content of the update message that was triggered just a few seconds ago is exactly the same.
  
The second expiration timer used by RIP. As long as the router receives a route to a specific destination, it initializes the timer for the expiration of the destination. The expiration timer is set to 180 seconds, but is always initialized every 30 seconds in a stable network. When the network is unstable, the timer time interval indicates that the route is invalid.
  
The garbage collection timer for the last RIP timer. The router marks invalid routes with an invalid scale of infinity and sets the garbage collection timer. At this time, the timer works within 120 seconds. During this period, when the router sets the scale fee to an infinite number, the message will be published. The route entry is published in this way, and the route entry in the adjacent route table can be quickly deleted from the route table.
  
The RIP protocol also has its drawbacks:
  
Small Network diameter
  
RIP defines the infinite scale (cost) as 16, which restricts the size of all networks using RIP. Because the scale must be an integer, the network fee must be at least 1. In the RIP-based Internet, all systems are no more than 15 networks away from any other systems. This size is called the network diameter.
  
This restriction imposes a Great limit on the flexibility of the administrator to allocate fees. The most direct way for administrators to allocate fees is to set the fees for each network to 1. However, in this allocation mode, RIP selects the path with the minimum cost regardless of the channel capacity on the path. Therefore, it will discard the "long" high-speed path and transmit data through the "short" path with low efficiency. To avoid this situation, the administrator can allocate more than 1 of the cost to inefficient links and artificially increase the cost. The result is that the maximum network diameter decreases, further limiting the network size of RIP.
  
Slow response to network changes
  
It takes 180 seconds for a router in the RIP network to fail to identify the router. the typical value in OSPF is 1 ~ 2 seconds.
  
Multicast is not supported.
  
In RIP, group member information is not published. Therefore, it does not support multicast routing. To achieve multicast routing, you need to use it with other protocols.
  
  
Gated configuration
  
Gated supports RIP, OSPF, IS-IS, and other routing protocols. Here we will focus on the configuration of the RIP protocol. for configurations of other protocols, you can configure the protocol by referring to the relevant help documentation.
  
First, modify the/etc/sysconfig/network file so that FORWARD_IPV4 = yes. Create a file named gated. conf in the/etc/directory, which contains the configuration information to be filled in. The configuration syntax of the RIP protocol is as follows:
  
Rip yes | no | on | off [{
Broadcast;
Nobroadcast;
Nocheckzero;
Preference;
Defaultmetric metric;
Query authentication [none | [[simple | md5] password];
Interface interface_list
[Noripin] | [ripin]
[Noripout] | [ripout]
[Metricin metric]
[Metricout metric]
[Version 1] | [version 2 [multicast | broadcast]
[[Secondary] authentication [none | [[simple | md5] password];
Trustedgateways gateway_list;
Sourcegateways gateway_list;
Traceoptions trace_options;
}];
  
The preceding configuration syntax is used to start or disable the operation of the RIP protocol, and some parameters of the RIP protocol are set. The meanings of parameters are as follows:
  
Broadcast
Indicates that the RIP group will be broadcast. This is useful when you broadcast static routes or RIP route entries generated by other protocols.
Nobroadcast
Indicates that the RIP group is not broadcast on the interface of course.
Nocheckzero
Indicates that RIP does not process the reserved domain in the RIP group. Generally, RIP rejects non-zero groups.
Preference
Set the preference of the RIP route. the default value is 100. this value can be overwritten by other given policies.
Metric
Defines the scale (metric) used when RIP ads are used to obtain route information from other routing protocols ). The default value is 16 (inaccessible ).
Query authentication [none | [[simple | md5] password];
Set the authentication password. Authentication is not required by default.
Interface interface_list
Set parameters for a specific interface.
Possible parameters are as follows:
Noripin
The RIP group received by the specified API provider is invalid.
Ripin
This is the default parameter. Opposite to noripin.
Noripout
No RIP group is sent on the specified interface. The default value is to send RIP packets to all broadcast and non-broadcast API vendors.
Ripout
This is the default value. It is opposite to noripout.
Metricin metric
Specify the scale (metric) added before the new route table entry is added to the kernel route table ). The default value is 1.
Metricout metric
Specifies the added value of the scale before the RIP is sent through a specific interface. The default value is 0.
Version 1
Specify the RIP protocol Group for the first version. This is the default value.
Version 2
The second version of the RIP protocol group is sent to the specified API provider. If IP multicast can be used, a group of the second version is sent by default. if multicast is not supported, a RIP Group of the second version compatible with the first version is used.
Multicast
Indicates that the RIP Group of the second version on a specific interface is sent using multicast.
Broadcast
Indicates that broadcast is used on a specific interface to send RIP groups of the second version compatible with the first version, even if the interface supports multicast.
[Secondary] authentication [none | [simple | md5] password]
Define the authentication method. It is only useful for the RIP protocol of the second version. The default value is no identity authentication.
Trustedgateways gateway_list
Defines the gateway that RIP receives the RIP update Group. Gateway_list is a simple list of host names or IP addresses. By default, all routers on the shared network are considered to support the provision of RIP update information.
Sourcegateways gateway_list
Defines the list of routers in which RIP sends packets directly, instead of multicast or broadcast.
Traceoptions trace_options
Set the RIP trace option. Detailed settings are omitted.
  
Below are some configuration examples:
Configuration 1:
#
#
# This configuration runs RIP in quiet mode, it only listens
# Packets, no matter how many interfaces are configured.
#
  
Rip yes {
Nobroadcast;
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.