Original intention:
I built a DHCP server on top of CentOS, because the DHCP request sent by the client was tagged, in order for DHCP server to properly response the IP of the client one address pool.
DHCP ETH port is eth0
Realize:
Add in/etc/rc.local
Vconfig Add eth0 1002
Ifconfig eth0.1002 90.0.0.1 up
Description
Linux boot, load the kernel, and then load the Inittab file, Inittab file has an entry Si::sysinit:/etc/rc.d/rc.sysinit specify the next file to be loaded Rc.sysinit, after the file is loaded, load /ETC/RC.D/RC. RUNLEVEL.D the startup script in the directory, and finally loads the/etc/rc.d/rc.local file.
In RC. RUNLEVEL.D folder, the storage is a soft link, linked to the/etc/rc.d/init.d script file, and/etc/rc.d/init.d folder and/etc/init.d folder is the same,/ETC/INIT.D is actually soft link to/ The Etc/rc.d/init.d folder.
Suppose you have a script, you need it to boot, there are 2 methods, the first is to register it as a system service, that is, put it in the/ETC/INIT.D directory, and in the script, add a line # chkconfig:345 85 35, then you can use the Chkconfig command to start the boot. Because in the/ETC/INIT.D directory, you can also control the script with service commands. The second is that in the/etc/rc.d/rc.local file, the path of the script is written directly, and when the Rc.local file is loaded on the boot, it will naturally start the script. This script cannot be controlled with Chkconfig and service commands.
Configuring VLANs with Vconfig under Linux