In Linux, the interface control script is used to activate and deactivate the system interface. sbinifdown and sbinifup are two main interface control scripts, which take effect by calling the configuration files in the etcsysconfignetwork-scripts directory. The ifup and ifdown interfaces are the link symbols pointing to the sbin directory.
In Linux, the interface control script is used to activate and deactivate system interfaces,/Sbin/ifdownAnd/Sbin/ifupAre two main interface control scripts, which are called/Etc/sysconfig/network-scripts/The configuration file in the directory takes effect.
The ifup and ifdown interfaces are the link symbols pointing to the/sbin/directory. When using these two scripts, you must specify the interface name, as shown in figure
~] # Ifup eth0 common users can also use ifup and ifdown
CommandThe interface configuration is also related to the interface configuration.
Many network initialization tasks are required when a network interface is started. Most of the operations are performed by/etc/rc. d/init. d/FuNcTionsAnd/etc/sysconfig/network-scripts/Network-functionsFor more information about the implementation of these two files, see Linux network related function files.
After you verify that an interface has been configured and the user has the permission to control the interface, the script will enable or disable the interface. The following are common interface control scripts in the/etc/sysconfig/network-scripts/directory:
Ifup-AliasEs
When an alias interface configuration file exists, configure multiple IP addresses for the specified interface.
Ifup-ippp and ifdown-ippp
Enable and disable the ISDN interface.
Ifup-ipsec and ifdown-ipsec
Enable and disable IPsec connections.
Ifup-ipv6 and ipdown-ipv6
Enable and disable IPv6 interfaces.
Ifup-plip
Enable the PLIP interface.
Ifup-plusb
Enable the USB interface for the network connection.
Ifup-post and ifdown-post
Contains the commands to be executed after an interface is enabled or disabled.
Ifup-ppp and ifdown-ppp
Enable and disable the PPP interface.
Ifup-routes
When an interface is enabled, add a static route for the device.
Ifup-sit and ifdown-sit
The function to be called to enable or disable IPv6 channels in an IPv4 connection.
Ifup-sl and ifdown-sl
Enable and disable the SLIP interface.
Ifup-wireLess
Enable the wireless interface.
Delete or change
/Etc/sysconfig/network-scripts/Any scripts in the directory may cause interface connection errors or failures. Therefore, you must change the content only when you are familiar with it.
At the same time, the simplest way to operate all network scripts is to use the/sbin/service command to operate the network service (/etc/rc. d/init. d/network), as shown in
~] #/Sbin/service network <action>
<Action> it can be start, stop, or restart (start, stop, or restart)
Run the following command to view the status of the configured device and the currently activated network interface.
~] #/Sbin/service network
StatUs