System environment: Linux kernel 2.6.35. (This environment is the one in the previous article that replaced the Ubuntu kernel)
The compilation process is as follows:
1) First, you need to download the patch file: Linux-kernel-v2.6.35-mpls1.980.patch. Download Link:
Http://ftp.jaist.ac.jp/pub/sourceforge/m/project/mp/mpls-linux/mpls-linux/Patches/linux-kernel-v2.6.35.13-mpls1.980.patch
Or:
http://zh.sourceforge.jp/projects/sfnet_mpls-linux/downloads/mpls-linux/Patches/linux-kernel-v2.6.35.13-mpls1.980.patch/
2) Copy the downloaded patch file to the/usr/src/directory. Then hit the file into the kernel and enter the following command:
# CP Linux-kernel-v2. 6.35-mpls1. 980. Patch /USR/SRC // copy files to/usr/src directory /usr/src/linux-2.6. // First go to the kernel home directory Patch -P1 <. /linux-kernel-v2. 6.35-mpls1. 980. Patch // load the patch file into the kernel file.
3) re-compile the kernel
$ cd/usr/src/linux-2.6. * $ sudo make menuconfig
At this point, the terminal will pop up a configuration interface, select the MPLS option, and then save the exit.
Networking Options--->
Mulitprtocol Label Switching
Ip:mplssuppor
In addition, it is recommended that MPLS be compiled directly into the Linux kernel instead of module compilation, and if the module is selected, it may not be loaded automatically after the system compiles, which may cause the MPLS service to fail to start.
That is, when you select the option associated with MPLS, select Y, which is: "*", which indicates that the system kernel is compiled. Instead of selecting M, this represents the module.
4) Compile the kernel again and enter the following command in turn.
$sudo MakeMrproper//clean up old files that have been compiled before, and if you are compiling for the first time, do not. $ sudo Make //the process takes a longer time to recompile the kernel. There may be a problem with using this command directly, you can use: sudo make config_debug_section_mismatch=y$ sudo Make Install $ sudo MakeModules//compiling the module$ sudo MakeModules_install//Mounting Module
After the compilation is complete, the MPLS module is installed.
Note that there may be various errors in compiling the kernel, the solution to the error can refer to this blog: Ubuntu system kernel Replacement
To compile MPLS into the Linux kernel