Analysis of the starting process of static route in Rhel/centos

Source: Internet
Author: User

This paper analyzes the starting process of static route of Rhel/centos system, so that students can understand the starting process of Linux system.

can help students to better understand the Linux system, also can help the usual troubleshooting.


-System startup script

/etc/init.d/network, this script is a critical line initiated by the bash script, static route:

Action $ "Bringing Up interface $i:"./ifup $i Boot

Ifup refers to the/etc/sysconfig/network-scripts/ifup, $i refers to interface, such as ETH0,BOND0.

Boot can actually be no more.


-Open the Ifup script, where the two most critical lines are:

otherscript= "/etc/sysconfig/network-scripts/ifup-${devicetype}" exec ${otherscript} ${config}

DeviceType is defined in/etc/sysconfig/network-scripts/network-functions, where the DeviceType variable is assumed to be eth,config, then the executed statement is:

Exec/etc/sysconfig/network-scripts/ifup-eth $


-Re-profiling the/etc/sysconfig/network-scripts/ifup-eth script, the key is the last line:

Exec/etc/sysconfig/network-scripts/ifup-post ${config} ${2}


-then analyze/etc/sysconfig/network-scripts/ifup-post, which has a line:

/etc/sysconfig/network-scripts/ifup-routes ${realdevice} ${devname}


-Finally Analysis/etc/sysconfig/network-scripts/ifup-routes, this script is used to start the static route script, there are two functions: Handle_file () and Handle_ip_file (), are used to add routes, but they do not have the same file format, that is, static route files can be in two different formats.


-Below is an example of how to automatically load a static route at system boot, such as to add a static route to the Bond1 interface, you need to create the file:/etc/sysconfig/network-scripts/route-bond1, Then add the following line to the file (for example):

10.140.0.0/15 via 10.9.214.1

Another form of the students to study their own, here will not repeat.


This article from "Linux operation and Maintenance" blog, declined reprint!

Analysis of the starting process of static route in Rhel/centos

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.