Network interface management method and device, medium and equipment
By monitoring the connection status of the physical network interface and dynamically executing configuration scripts, the problem that a single physical network interface cannot establish multiple wan access paths is solved, and the flexibility and reliability of the network are improved.
Patent Information
- Application Number
- CN202510222210.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-27
- Publication Date
- 2025-05-30
AI Technical Summary
The prior art cannot use a single physical network port to establish multiple wan access paths, resulting in limited network scalability and service diversity, and lack of effective redundancy and backup mechanisms in the face of network failures.
By monitoring the connection status of the physical network interface, dynamically execute corresponding configuration scripts, each wan port can independently configure different access methods, thereby establishing multiple logical wan links on a physical network interface. The system generates policy routing tables and configures firewall rules to intelligently manage the routing and access rights of business traffic.
The establishment of multiple logical wan links on a physical network port is realized, which improves the flexibility and reliability of the network, solves the problem that a single physical network port cannot support multiple wan access paths at the same time, reduces manual intervention, and improves the automation management level of the network.
Smart Images

Figure CN120075047A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of network interface management, and particularly to a method, apparatus, medium, and device for network interface management. Background Art
[0002] In the fields of computer networks and communications, with the continuous expansion of Internet services and the increasing growth of user requirements, higher demands are placed on the stability, security, and flexibility of network connections. Traditional network devices usually only support a single physical network interface (WAN port) to connect to the Internet. This approach limits the scalability of the network and the diversity of services. In addition, the configuration of a single WAN port also appears vulnerable in the face of network failures, lacking effective redundancy and backup mechanisms. To address the above issues, technicians have proposed the concepts of multi-WAN port routers and network devices, which can connect to different network service providers through multiple physical interfaces to achieve functions such as load balancing, failover, and bandwidth aggregation. However, these devices still face some challenges in practical applications:
[0003] Single access mode limitation: Traditional multi-WAN port devices usually can only configure a single WAN access mode for each physical interface and cannot use multiple access modes simultaneously, such as using PPPoE and L2TP at the same time.
[0004] Difficult business matching: In a multi-WAN port environment, how to correctly allocate different traffic flows (such as VoIP, video streams, regular data transmission) to the most suitable WAN port to ensure service quality and efficiency is a technical challenge.
[0005] Network configuration complexity: With the increase in the number of WAN ports, the configuration and management of network devices become more complex, and more efficient automation tools and methods are needed to simplify this process.
[0006] Mobile network integration: With the development of 4G / 5G mobile networks, how to use mobile networks as a supplement or backup to wired networks to improve the robustness of the network is a new technical requirement.
[0007] Network security: In a multi-WAN port environment, network security management becomes more complex, and more refined access control and firewall rules are needed to protect the network from unauthorized access and network attack threats.
[0008] These impacts result in the inability of the prior art to establish multiple WAN access paths using a single physical network interface. Summary of the Invention
[0009] The present invention provides a method, apparatus, medium, and device for network interface management to solve the problem in the prior art that multiple WAN access paths cannot be established using a single physical network interface.
[0010] In a first aspect, the present application provides a method for managing a network interface, including:
[0011] Obtain the connection status of a preset physical network interface;
[0012] If the connection status is connected, run the first configuration scripts of each WAN port according to various preset configuration parameters;
[0013] Generate respective policy routing tables and configure respective firewall rules according to the first configuration scripts of each WAN port,
[0014] Manage the routing and access permissions of each service traffic according to the respective policy routing tables and respective firewall rules;
[0015] If the connection status is disconnected, obtain the respective network protocol client process identifiers of the access methods of the current WAN ports;
[0016] Terminate the first processes of the respective network protocol client process identifiers and delete the respective first configuration scripts, respective first process files of the respective network protocol client process identifiers, and the first IP configurations of the current WAN ports.
[0017] By monitoring the connection status of the physical network interface and dynamically executing corresponding configuration scripts according to this status, the present application solves the problem in the prior art that multiple WAN access paths cannot be established using a single physical network interface. When the connection status of the physical network interface is connected, the system automatically runs the configuration scripts of each WAN port according to preset parameters, and these scripts can independently configure different access methods for each WAN port, thereby realizing the establishment of multiple logical WAN links on a single physical network interface. Subsequently, the system generates corresponding policy routing tables and configures firewall rules to intelligently manage the routing and access permissions of different service traffic, ensuring that the traffic is transmitted through the correct WAN port. When the connection status is disconnected, the system quickly terminates the relevant network protocol client processes and clears the corresponding configurations and IP information to quickly release and reallocate network resources. This process not only improves the flexibility and reliability of the network, but also reduces manual intervention through automated management, solving the technical problem that a single physical network interface cannot support multiple WAN access paths simultaneously.
[0018] As a preferred embodiment of the first aspect, it further includes:
[0019] Obtain the configuration parameter update requirements of each WAN port;
[0020] Read respective new configuration parameters according to the configuration parameter update requirements;
[0021] Terminate the second process of each network protocol client process identifier for each WAN port and delete each second configuration script, each second process file, and the second IP configuration of each current WAN port;
[0022] Run the second configuration script for each WAN port according to the respective new configuration parameters.
[0023] In this preferred embodiment, the present application significantly improves the flexibility and adaptability of network management by introducing a dynamic configuration update mechanism. First, the system can identify and respond to the configuration parameter update requirements of each WAN port, which allows network administrators to adjust the configuration according to network changes or business needs to optimize network performance. Then, the system reads the new configuration parameters, which ensures that network devices can operate according to the latest settings and maintain the optimal state of the network. Subsequently, the system terminates the relevant network protocol client processes and deletes the old configuration scripts and IP configurations, which clears the outdated network settings and paves the way for the new configuration. Finally, running the second configuration script according to the new configuration parameters enables network devices to quickly adapt to the new network environment, ensuring business continuity and network stability. In summary, through the automated configuration update process, the present application not only improves the network's response speed to changes but also enhances the network's manageability and reliability, solves the problem of cumbersome and time-consuming network configuration update processes in the prior art, and realizes the rapid iteration and precise control of network configurations.
[0024] As a preferred embodiment of the first aspect, running the first configuration script for each WAN port according to the preset respective configuration parameters; generating respective policy routing tables and configuring respective firewall rules according to the first configuration script of each WAN port specifically includes:
[0025] Run the first configuration script for each WAN port according to the preset respective configuration parameters;
[0026] Obtain the respective configuration information of each network according to the first configuration script;
[0027] Generate respective policy routing tables and configure respective firewall rules according to the respective network configuration information.
[0028] In this preferred embodiment, the present application realizes the efficient management of network interfaces and the optimized allocation of service traffic through an automated configuration management process. First, the system automatically runs the first configuration scripts for each WAN port according to the preset configuration parameters. This step ensures that the network interfaces can be initialized according to the established service requirements and network conditions. Then, based on these first configuration scripts, the system obtains the configuration information of each network, which provides the necessary data support for subsequent network management and traffic control. Finally, using the obtained network configuration information, the system generates the corresponding policy routing table and configures the firewall rules to achieve precise routing and security control of different service traffic. This coherent process not only improves the automation level of network configuration, reduces manual intervention, but also enhances the adaptability and response speed of the network to different service requirements, thereby improving the efficiency and security of the entire network. Through this automated and intelligent network management method, the present application effectively solves the problems of rigid network configuration, slow response, and low security in the prior art, and provides a more flexible, reliable, and secure network service for network operators and users.
[0029] As a preferred embodiment of the first aspect, running the first configuration scripts for each WAN port according to the preset configuration parameters specifically includes:
[0030] Configuring the PPPoE dial-up connection for each WAN port according to the preset PPPoE parameter group;
[0031] Configuring the L2TP connection for each WAN port according to the preset L2TP parameter group;
[0032] Running the first configuration scripts for each WAN port according to the PPPoE dial-up connection of each WAN port and the L2TP connection of each WAN port.
[0033] In this preferred embodiment, the present application improves the flexibility and adaptability of network interfaces through refined configuration management. First, the system configures the PPPoE dial-up connections of each WAN port according to a preset PPPoE parameter group. This step enables each WAN port to establish a secure point-to-point connection based on specific authentication information such as an account and password. Next, the system configures the L2TP connections of each WAN port according to the L2TP parameter group, ensuring the security and stability of the virtual private network connection established through the Layer 2 Tunneling Protocol. These two steps together provide diverse connection methods for the WAN ports to adapt to different network environments and service requirements. Finally, based on these PPPoE and L2TP connections, the system runs the first configuration script for each WAN port to automatically complete the configuration and optimization of the network interface. This coherent process not only improves the efficiency of network configuration, reduces manual intervention, but also enhances the adaptability of the network to different service requirements, thereby improving the stability and reliability of the entire network. Through this refined configuration management, the present application effectively solves the problem in the prior art that a single physical network port cannot flexibly adapt to multiple network connection requirements, and provides a more flexible, reliable and secure network service for network operators and users.
[0034] As a preferred embodiment of the first aspect, running the first configuration script for each WAN port according to the preset configuration parameters further includes:
[0035] Running the udhcpc application according to a preset DHCP configuration parameter script;
[0036] Running the first configuration script for each WAN port according to the IP address information obtained by the udhcpc application.
[0037] In this preferred embodiment, by introducing a preset DHCP configuration parameter script, the present application enables network devices to automatically run the udhcpc application to obtain an IP address. This step automates the IP configuration process and improves the configuration efficiency and accuracy of network interfaces. Subsequently, using the IP address information obtained by the udhcpc application, the system can accurately run the first configuration script for each WAN port to ensure that each WAN port can be optimized according to its specific IP configuration. This configuration script running mechanism based on actual IP address information not only improves the accuracy and reliability of network configuration, but also enhances the adaptability of the network to a dynamic IP environment, thereby improving the stability and service continuity of the entire network. Therefore, through the automated and intelligent IP configuration and script running method, the present application effectively solves the problems of manual operation dependence, slow response and configuration errors in network configuration in the prior art, and provides a more efficient, reliable and flexible network service for network operators and users.
[0038] Second aspect, the present application provides a management device for a network interface. The management device for the network interface includes an acquisition module, a connection module, and a disconnection module;
[0039] The acquisition module is used to acquire the connection status of a preset physical network interface;
[0040] The connection module is used to, if the connection status is connected, run the first configuration scripts of each WAN port according to each preset configuration parameter;
[0041] Generate each policy routing table and configure each firewall rule according to the first configuration scripts of each WAN port,
[0042] Manage the routing and access permissions of each service traffic according to each policy routing table and each firewall rule;
[0043] The disconnection module is used to, if the connection status is disconnected, acquire each network protocol client process identifier of the access mode of each current WAN port;
[0044] Terminate the first process of each network protocol client process identifier and delete each first configuration script, each first process file of each network protocol client process identifier, and the first IP configuration of each current WAN port.
[0045] This device uses three modules to divide labor and coordinate work, which can better manage the network interface. The present application solves the problem in the prior art that multiple WAN access paths cannot be established using a single physical network interface by monitoring the connection status of the physical network interface and dynamically executing corresponding configuration scripts according to this status. When the connection status of the physical network interface is connected, the system automatically runs the configuration scripts of each WAN port according to preset parameters. These scripts can independently configure different access modes for each WAN port, thereby realizing the establishment of multiple logical WAN links on a single physical network interface. Subsequently, the system generates corresponding policy routing tables and configures firewall rules to intelligently manage the routing and access permissions of different service traffic, ensuring that traffic is transmitted through the correct WAN port. When the connection status is disconnected, the system quickly terminates the relevant network protocol client processes and clears the corresponding configuration and IP information to quickly release and reallocate network resources. This process not only improves the flexibility and reliability of the network, but also reduces manual intervention through automated management, solving the technical problem that a single physical network interface cannot support multiple WAN access paths simultaneously.
[0046] As a preferred embodiment of the second aspect, it further includes:
[0047] Acquire the configuration parameter update requirements of each WAN port;
[0048] Update the requirements according to the configuration parameters and read each new configuration parameter;
[0049] Terminate the second process of each network protocol client process identifier of each WAN port and delete each second configuration script, each second process file of each network protocol client process identifier, and the second IP configuration of each current WAN port;
[0050] Run the second configuration script of each WAN port according to the respective new configuration parameters.
[0051] In this preferred embodiment, the present application significantly improves the flexibility and adaptability of network management by introducing a dynamic configuration update mechanism. First, the system can identify and respond to the configuration parameter update requirements of each WAN port, which allows network administrators to adjust the configuration according to network changes or business needs to optimize network performance. Next, the system reads the new configuration parameters, and this step ensures that network devices can operate according to the latest settings to maintain the optimal state of the network. Subsequently, the system terminates the relevant network protocol client processes and deletes the old configuration scripts and IP configurations. This process clears the outdated network settings and paves the way for the new configuration. Finally, run the second configuration script according to the new configuration parameters, enabling network devices to quickly adapt to the new network environment and ensuring business continuity and network stability. In summary, through the automated configuration update process, the present application not only improves the network's response speed to changes but also enhances the network's manageability and reliability, solves the problem of cumbersome and time-consuming network configuration update processes in the prior art, and realizes the rapid iteration and precise control of network configurations.
[0052] As a preferred embodiment of the second aspect, running the first configuration script of each WAN port according to the preset configuration parameters; generating each policy routing table and configuring each firewall rule according to the first configuration script of each WAN port specifically includes:
[0053] Run the first configuration script of each WAN port according to the preset configuration parameters;
[0054] Obtain the configuration information of each network according to the first configuration script;
[0055] Generate each policy routing table and configure each firewall rule according to the respective network configuration information.
[0056] In this preferred embodiment, the present application realizes the efficient management of network interfaces and the optimized allocation of service traffic through an automated configuration management process. First, the system automatically runs the first configuration scripts for each WAN port according to the preset configuration parameters. This step ensures that the network interfaces can be initialized according to the established service requirements and network conditions. Then, based on these first configuration scripts, the system obtains the configuration information of each network, which provides the necessary data support for subsequent network management and traffic control. Finally, using the obtained network configuration information, the system generates the corresponding policy routing table and configures the firewall rules, achieving precise routing and security control of different service traffic. This coherent process not only improves the automation level of network configuration, reduces manual intervention, but also enhances the adaptability and response speed of the network to different service requirements, thus improving the efficiency and security of the entire network. Through this automated and intelligent network management method, the present application effectively solves the problems of rigid network configuration, slow response, and low security in the prior art, providing a more flexible, reliable, and secure network service for network operators and users.
[0057] In a third aspect, the present application provides a computer-readable storage medium, which includes a stored computer program. When the computer program runs, it controls the device where the computer-readable storage medium is located to execute the management method of a network interface as described above. Its beneficial effects are the same as those of the management method of a network interface provided in the first aspect of the present application.
[0058] In a fourth aspect, the present application provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements any one of the network interface management methods described in the first aspect. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 : It is a schematic flowchart of an embodiment of the network interface management method provided by the present application;
[0060] Figure 2 : It is a schematic structural diagram of an embodiment of the network interface management device provided by the present application. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0061] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
[0062] Embodiment 1
[0063] Please refer to Figure 1 , a method for managing a network interface provided by an embodiment of the present invention.
[0064] In this embodiment, the process of the network interface management method in the present application is described in detail through steps S01 - S06.
[0065] This application realizes multiple WAN port access based on a physical network port (hereinafter referred to as eth1), and matches different services with each WAN port. A device can have multiple physical network ports, among which multiple WAN ports can be configured. Currently, it is described that the device has one WAN port and multiple LAN ports.
[0066] S01: Obtain the connection status of the preset physical network interface.
[0067] As a preferred embodiment of Embodiment 1, the connection status of the preset physical network interface includes the connected and disconnected states.
[0068] S02: If the connection status is connected, run the first configuration script of each WAN port according to the preset configuration parameters.
[0069] As a preferred embodiment of Embodiment 1, the running of the first configuration script of each WAN port according to the preset configuration parameters is specifically as follows:[[]]
[0070] According to the preset configuration parameters related to wan0 and the LAN physical network port (wan0 switch, IP of the LAN physical network port bridge br0, device web page http port A and https port B), if the wan0 switch is closed, then process the next WAN port wan1; if the wan0 switch is open, then generate / tmp / .tmp_udhcp_wan0.sh and / tmp / .udhcpc_v4_wan0.script according to the preset configuration, and then execute the script / tmp / .tmp_udhcp_wan0.sh;
[0071] According to the preset configuration related to wan1 and TR069, if the wan1 switch is closed, then process the next WAN port wan2; if the wan1 switch is open, then generate scripts / tmp / .tmp_pppd_wan1.sh, / tmp / .ip_up_wan1.sh, and / tmp / .ip_down_wan1.sh according to the preset configuration;
[0072] According to the preset configurations related to wan2 and VOIP, if the wan2 switch is off, then process the next wan3; if the wan2 switch is on, then generate the scripts / tmp / .tmp_pppd_wan2.sh, / tmp / .ip_up_wan2.sh, and / tmp / .ip_down_wan2.sh according to the preset configurations.
[0073] According to the preset configurations related to wan3, L2TP service A, and WIFI bridge br1, if the wan3 switch is off, then process the next wan3; if the wan3 switch is on, then generate the scripts / tmp / .tmp_pppd_wan3.sh, / tmp / .ip_up_wan3.sh, and / tmp / .ip_down_wan3.sh according to the preset configurations.
[0074] According to the preset configurations related to wan4, L2TP service B, and WIFI bridge br2, if the wan4 switch is off, then process the next wan5; if the wan5 switch is on, then generate the scripts / tmp / .tmp_pppd_wan4.sh, / tmp / .ip_up_wan4.sh, and / tmp / .ip_down_wan4.sh according to the preset configurations.
[0075] According to the preset configurations related to wan5 and WIFI bridge br2, if the wan5 switch is off, then process the next wan6; if the wan5 switch is on, then generate the scripts / tmp / .tmp_pppd_wan5.sh, / tmp / .ip_up_wan5.sh, and / tmp / .ip_down_wan5.sh according to the preset configurations.
[0076] In this preferred embodiment, the present application improves the flexibility and adaptability of network interfaces through refined configuration management. First, the system configures the PPPoE dial-up connections of each WAN port according to a preset PPPoE parameter group. This step enables each WAN port to establish a secure point-to-point connection based on specific authentication information such as an account and password. Then, the system configures the L2TP connections of each WAN port according to the L2TP parameter group, ensuring the security and stability of the virtual private network connection established through the Layer 2 Tunneling Protocol. These two steps together provide diverse connection methods for the WAN ports to adapt to different network environments and service requirements. Finally, based on these PPPoE and L2TP connections, the system runs the first configuration script for each WAN port to automatically complete the configuration and optimization of the network interface. This coherent process not only improves the efficiency of network configuration, reduces manual intervention, but also enhances the adaptability of the network to different service requirements, thereby improving the stability and reliability of the entire network. Through this refined configuration management, the present application effectively solves the problem in the prior art that a single physical network interface cannot flexibly adapt to multiple network connection requirements, providing a more flexible, reliable, and secure network service for network operators and users.
[0077] S03: Generate each policy routing table and configure each firewall rule according to the first configuration script of each WAN port.
[0078] As a preferred embodiment of Embodiment 1, the generating each policy routing table and configuring each firewall rule according to the first configuration script of each WAN port is specifically as follows:
[0079] 1. The actual actions of the wan0 script include:
[0080] a. Run the udhcpc application in the background with the specified network card as eth1, the corresponding execution script as / tmp / .udhcpc_v4_wan0.script, and the process pid output file as / tmp / .udhcpc_v4_wan0.pid.
[0081] b. Add firewall rules. One is to only receive data packets from the wired LAN network interface bridge br0 with the protocol type TCP and ports A or B, and the other is to discard all data packets with the protocol type TCP and ports A or B, so as to achieve that only the physical network interface can access the device web page and other access methods cannot access the device web page.
[0082] When the DHCP lease is updated, it automatically triggers the execution of the instruction " / tmp / .udhcpc_v4_wan0.script renew&". When an IP is obtained, it automatically triggers the execution of the instruction " / tmp / .udhcpc_v4_wan0.script bound&". When the connection is released, it automatically triggers the execution of the instruction " / tmp / .udhcpc_v4_wan0.script deconfig&". When the parameter passed is "renew" or "bound", this script generates the policy routing table "multi_wired_table_wan0". When the parameter passed is "deconfig", it clears and deletes the policy routing table "multi_wired_table_wan0".
[0083] 2. The actual actions of the wan1 script include:
[0084] Running the script " / tmp / .tmp_pppd_wan1.sh" will run a pppd process in the background for PPPoE dialing. It specifies that the script automatically executed by this pppd process after successful dialing is " / tmp / .ip_up_wan1.sh", and the script automatically executed by this pppd process after the connection is disconnected is " / tmp / .ip_down_wan1.sh".
[0085] Running " / tmp / .ip_up_wan1.sh" will use the IP corresponding to the network card ppp5001 obtained after successful dialing and the TR069 server IP to generate the policy routing table "multi_wired_table_wan1", enabling the TR069 service to preferentially use the network card ppp5001 corresponding to wan1.
[0086] Running " / tmp / .ip_down_wan1.sh" will clear and delete the policy routing table "multi_wired_table_wan1".
[0087] 3. The actual actions of the wan2 script include:
[0088] Running the script " / tmp / .tmp_pppd_wan2.sh" will run a pppd process in the background for PPPoE dialing. It specifies that the script automatically executed by this pppd process after successful dialing is " / tmp / .ip_up_wan2.sh", and the script automatically executed by this pppd process after the connection is disconnected is " / tmp / .ip_down_wan2.sh".
[0089] Running / tmp / .ip_up_wan2.sh will use the IP corresponding to the network card ppp5002 obtained after successful dialing, as well as the IP of the VOIP server, to generate the policy routing table multi_wired_table_wan2, so as to ensure that VOIP services preferentially use the network card ppp5002 corresponding to wan2;
[0090] Running / tmp / .ip_down_wan2.sh will clear and delete the policy routing table multi_wired_table_wan2.
[0091] 4. The actual actions of the wan3 script include:
[0092] Running the / tmp / .tmp_pppd_wan3.sh script will run a pppd process in the background for pppoe dialing, and specify that the script automatically executed in the background after successful dialing is / tmp / .ip_up_wan3.sh, and the script automatically executed in the background after the connection is disconnected is / tmp / .ip_down_wan3.sh;
[0093] Running / tmp / .ip_up_wan3.sh will have the following actions:
[0094] a. Use the IP corresponding to the network card ppp5003 obtained after successful dialing, the IP of L2TP server A, and the IP of the WIFI bridge br1 to generate the policy routing table multi_wired_table_wan3 (including a static route for traffic to and from L2TP server A via the wan3 network card, i.e., ppp5003);
[0095] b. Enable the L2TP service and add a default route with the exit as the ppp0 network card and the next hop as the IP of the peer of the ppp0 network card to the policy routing table after successful connection. This enables the terminal devices connected to the WIFI bridge br1 to remotely access L2TP server A via the ppp0 network card.
[0096] Running / tmp / .ip_down_wan3.sh will clear and delete the policy routing table multi_wired_table_wan3.
[0097] 5. The actual actions of the wan4 script include:
[0098] Running the / tmp / .tmp_pppd_wan4.sh script will run a pppd process in the background for PPPoE dialing, and specify that the script automatically executed by the pppd process in the background after successful dialing is / tmp / .ip_up_wan4.sh, and the script automatically executed by the pppd process in the background after the connection is disconnected is / tmp / .ip_down_wan4.sh;
[0099] Running / tmp / .ip_up_wan4.sh will have the following actions:
[0100] a. Generate a policy routing table multi_wired_table_wan4 using the IP corresponding to the network card ppp5004 obtained after successful dialing, the IP of L2TP server B, and the IP of WIFI bridge br2 (including a static route for traffic to L2TP server B via the wan4 network card, i.e., ppp5003);
[0101] b. Start the L2TP service and add a default route with the exit as the ppp1 network card and the next hop as the IP of the peer of the ppp1 network card to the policy routing table after successful connection. Thus, the terminal devices connected to the WIFI secondary bridge br2 can remotely access L2TP server B through the ppp1 network card;
[0102] Running / tmp / .ip_down_wan4.sh will clear and delete the policy routing table multi_wired_table_wan4.
[0103] 6. The actual actions of the wan5 script include:
[0104] Running the / tmp / .tmp_pppd_wan5.sh script will run a pppd process in the background for PPPoE dialing, and specify that the script automatically executed by the pppd process in the background after successful dialing is / tmp / .ip_up_wan5.sh, and the script automatically executed by the pppd process in the background after the connection is disconnected is / tmp / .ip_down_wan5.sh;
[0105] Running / tmp / .ip_up_wan5.sh will have the following actions:
[0106] a. Generate a policy routing table multi_wired_table_wan5 using the IP corresponding to the network card ppp5005 obtained after successful dialing and the IP of WIFI bridge br3. Thus, the terminals connected to the WIFI bridge br3 can access the Internet through ppp5005.
[0107] Further, it is determined whether the SIM card is inserted. If there is a SIM card, the mobile network is enabled to obtain the network card wan6, and a default route with the default gateway being wan6 is configured in the main routing table.
[0108] In this preferred embodiment, the present application realizes the efficient management of network interfaces and the optimized allocation of service traffic through an automated configuration management process. First, the system automatically runs the first configuration scripts of each wan port according to the preset configuration parameters. This step ensures that the network interfaces can be initialized according to the established service requirements and network conditions. Then, based on these first configuration scripts, the system obtains the configuration information of each network, which provides the necessary data support for subsequent network management and traffic control. Finally, using the obtained network configuration information, the system generates the corresponding policy routing table and configures firewall rules, achieving precise routing and security control of different service traffic. This coherent process not only improves the automation level of network configuration, reduces manual intervention, but also enhances the adaptability and response speed of the network to different service requirements, thereby improving the efficiency and security of the entire network. Through this automated and intelligent network management method, the present application effectively solves the problems of rigid network configuration, slow response, and low security in the prior art, providing a more flexible, reliable, and secure network service for network operators and users.
[0109] S04: Manage the routing and access permissions of each service traffic according to the respective policy routing tables and each firewall rule.
[0110] S05: If the connection status is disconnected, obtain the process identifiers of each network protocol client for the access method of each current wan port.
[0111] S06: Terminate the first process of each of the process identifiers of the network protocol clients and delete each first configuration script, each first process file, and the first IP configuration of each current wan port.
[0112] As a preferred embodiment of Embodiment 1, the terminating the first process of each of the process identifiers of the network protocol clients and deleting each first configuration script, each first process file, and the first IP configuration of each current wan port is specifically as follows:
[0113] If it is detected that the connection status of eth1 is disconnected, perform the disconnection handling operation, specifically as follows:
[0114] 1. Dispose of wan0:
[0115] Read the file / tmp / .udhcpc_v4_wan0.pid to obtain the pid of the udhcpc process currently used by wan0, then kill the process based on this pid, then delete the corresponding execution script and the process pid file, and clear the IP of the eth1 network card.
[0116] 2. Dispose of wan1, read / tmp / .pppd_wan1_ppp.pid and / tmp / .udhcpc6_v6_wan1.pid to obtain the pids of the corresponding pppd and uhcpc6 processes, and kill the corresponding processes based on the pids.
[0117] 3. Dispose of wan2, the same as wan1;
[0118] 4. Dispose of wan3, the same as wan1;
[0119] 5. Dispose of wan4, the same as wan1;
[0120] 6. Dispose of wan5, the same as wan1.
[0121] As a preferred embodiment of Embodiment 1, it further includes:
[0122] If the relevant configuration parameters of a certain one of wan1 - wan5 are updated, then execute the corresponding disconnection disposal operation and then read the new parameters to execute the connection operation.
[0123] Configuration parameters:
[0124] PPPoE parameter group: PPPoE switch (i.e., the switch of a certain wan), account, password, MTU, L2TP parameter group: switch, server IP address, account, password, mtu;
[0125] 1. wan1 parameter group, including the TR069 server address, PPPoE parameter group;
[0126] 2. wan2 parameter group, including the VOIP server address, PPPoE parameter group;
[0127] 3. wan3 parameter group, including the PPPoE parameter group, L2TP parameter group;
[0128] 4. wan4 parameter group, including the PPPoE parameter group, L2TP parameter group;
[0129] 5. wan5 parameter group, including the PPPoE parameter group.
[0130] In this preferred embodiment, the present application significantly improves the flexibility and adaptability of network management by introducing a dynamic configuration update mechanism. First, the system can identify and respond to the configuration parameter update requirements of each WAN port, which allows network administrators to adjust the configuration according to network changes or business needs to optimize network performance. Then, the system reads the new configuration parameters, which ensures that network devices can operate according to the latest settings and maintain the optimal state of the network. Subsequently, the system terminates the relevant network protocol client processes and deletes the old configuration scripts and IP configurations, which clears the outdated network settings and paves the way for the new configuration. Finally, the second configuration script is run according to the new configuration parameters, enabling network devices to quickly adapt to the new network environment and ensuring service continuity and network stability. In summary, through the automated configuration update process, the present application not only improves the network's response speed to changes but also enhances the network's manageability and reliability, solves the problem of the cumbersome and time-consuming network configuration update process in the prior art, and realizes the rapid iteration and precise control of network configuration.
[0131] The present application solves the problem in the prior art of being unable to establish multiple WAN access paths using a single physical network interface by monitoring the connection status of the physical network interface and dynamically executing corresponding configuration scripts according to this status. When the connection status of the physical network interface is connected, the system automatically runs the configuration scripts for each WAN port according to preset parameters, and these scripts can independently configure different access methods for each WAN port, thus realizing the establishment of multiple logical WAN links on a single physical network interface. Subsequently, the system generates the corresponding policy routing table and configures the firewall rules to intelligently manage the routing and access permissions of different service traffic and ensure that the traffic is transmitted through the correct WAN port. When the connection status is disconnected, the system quickly terminates the relevant network protocol client processes and clears the corresponding configurations and IP information to quickly release and reallocate network resources. This process not only improves the flexibility and reliability of the network but also reduces manual intervention through automated management, solving the technical problem that a single physical network interface cannot support multiple WAN access paths simultaneously.
[0132] Embodiment 2
[0133] Please refer to Figure 2 , a network interface management device provided by an embodiment of the present application.
[0134] In this embodiment, the network interface management device includes an acquisition module 10, a connection module 20, and a disconnection module 30.
[0135] This application realizes multiple WAN port accesses based on a physical network interface (hereinafter referred to as eth1), and matches different services with each WAN port. A device can have multiple physical network interfaces, among which multiple can be configured as WAN ports. Currently, it is described that the device has one WAN port and multiple LAN ports.
[0136] The obtaining module 10 is used to obtain the connection status of a preset physical network interface.
[0137] As a preferred embodiment of Embodiment 2, the connection status of the preset physical network interface includes the connected state and the disconnected state.
[0138] The connection module 20 is used to judge that if the connection status is connected, according to each preset configuration parameter, run the first configuration script of each WAN port.
[0139] As a preferred embodiment of Embodiment 2, the running of the first configuration script of each WAN port according to each preset configuration parameter is specifically:
[0140] According to the preset configuration parameters related to wan0 and the LAN physical network interface (wan0 switch, IP of the LAN physical network interface bridge br0, device web page http port A and https port B), if the wan0 switch is closed, then process the next WAN port wan1; if the wan0 switch is open, then generate / tmp / .tmp_udhcp_wan0.sh and / tmp / .udhcpc_v4_wan0.script according to the preset configuration, and then execute the script / tmp / .tmp_udhcp_wan0.sh;
[0141] According to the preset configuration related to wan1 and TR069, if the wan1 switch is closed, then process the next WAN port wan2; if the wan1 switch is open, then generate the scripts / tmp / .tmp_pppd_wan1.sh, / tmp / .ip_up_wan1.sh, and / tmp / .ip_down_wan1.sh according to the preset configuration;
[0142] According to the preset configuration related to wan2 and VOIP, if the wan2 switch is closed, then process the next WAN port wan3; if the wan2 switch is open, then generate the scripts / tmp / .tmp_pppd_wan2.sh, / tmp / .ip_up_wan2.sh, and / tmp / .ip_down_wan2.sh according to the preset configuration;
[0143] According to the preset configurations related to wan3, L2TP service A, and WIFI bridge br1, if the wan3 switch is off, process the next wan3; if the wan3 switch is on, generate the scripts / tmp / .tmp_pppd_wan3.sh, / tmp / .ip_up_wan3.sh, and / tmp / .ip_down_wan3.sh according to the preset configurations.
[0144] According to the preset configurations related to wan4, L2TP service B, and WIFI bridge br2, if the wan4 switch is off, process the next wan5; if the wan5 switch is on, generate the scripts / tmp / .tmp_pppd_wan4.sh, / tmp / .ip_up_wan4.sh, and / tmp / .ip_down_wan4.sh according to the preset configurations.
[0145] According to the preset configurations related to wan5 and WIFI bridge br2, if the wan5 switch is off, process the next wan6; if the wan5 switch is on, generate the scripts / tmp / .tmp_pppd_wan5.sh, / tmp / .ip_up_wan5.sh, and / tmp / .ip_down_wan5.sh according to the preset configurations.
[0146] In this preferred embodiment, the present application improves the flexibility and adaptability of network interfaces through refined configuration management. First, the system configures the PPPoE dial-up connections of each wan port according to the preset PPPoE parameter group. This step enables each wan port to establish a secure point-to-point connection based on specific authentication information such as account and password. Then, the system configures the L2TP connections of each wan port according to the L2TP parameter group, ensuring the security and stability of the virtual private network connection established through the second layer tunneling protocol. These two steps together provide diverse connection methods for the wan ports to adapt to different network environments and service requirements. Finally, based on these PPPoE and L2TP connections, the system runs the first configuration scripts of each wan port to automatically complete the configuration and optimization of network interfaces. This coherent process not only improves the efficiency of network configuration, reduces manual intervention, but also enhances the adaptability of the network to different service requirements, thereby improving the stability and reliability of the entire network. Through this refined configuration management, the present application effectively solves the problem in the prior art that a single physical network port cannot flexibly adapt to multiple network connection requirements, providing a more flexible, reliable, and secure network service for network operators and users.
[0147] The connection module 20 is further configured to generate each policy routing table and configure each firewall rule according to the first configuration scripts of the respective wan ports.
[0148] As a preferred embodiment of Embodiment 2, generating respective policy routing tables and configuring respective firewall rules according to the first configuration scripts of the respective WAN ports specifically includes:
[0149] 1. The actual actions of the wan0 script include:
[0150] a. Run the udhcpc application in the background with the specified network card being eth1, the corresponding execution script being / tmp / .udhcpc_v4_wan0.script, and the process pid output file being / tmp / .udhcpc_v4_wan0.pid;
[0151] b. Add firewall rules. One is to only receive data packets from the wired LAN network interface bridge br0 with the protocol type being TCP and the port being A or B, and the other is to discard all data packets with the protocol type being TCP and the port being A or B, so as to enable only the physical network interface to access the device web page and prevent other access methods from accessing the device web page;
[0152] When the DHCP lease is updated, automatically trigger the execution instruction / tmp / .udhcpc_v4_wan0.script renew&, when an IP is obtained, automatically trigger the execution instruction / tmp / .udhcpc_v4_wan0.script bound&, and when the connection is released, automatically trigger the execution instruction / tmp / .udhcpc_v4_wan0.script deconfig&. When the passed parameter is renew or bound, this script generates the policy routing table multi_wired_table_wan0, and when the passed parameter is deconfig, clear and delete the policy routing table multi_wired_table_wan0.
[0153] 2. The actual actions of the wan1 script include:
[0154] Running the / tmp / .tmp_pppd_wan1.sh script will run a pppd process in the background for PPPoE dialing, and specify that the script automatically executed by this pppd process after successful dialing is / tmp / .ip_up_wan1.sh, and the script automatically executed by this pppd process after the connection is disconnected is / tmp / .ip_down_wan1.sh;
[0155] Running / tmp / .ip_up_wan1.sh will generate the policy routing table multi_wired_table_wan1 by using the IP corresponding to the network card ppp5001 obtained after successful dialing and the TR069 server IP, so as to enable the TR069 service to preferentially use the network card ppp5001 corresponding to wan1;
[0156] Running / tmp / .ip_down_wan1.sh will clear and delete the policy routing table multi_wired_table_wan1.
[0157] 3. The actual actions of the wan2 script include:
[0158] Running the / tmp / .tmp_pppd_wan2.sh script will run a pppd process in the background for PPPoE dialing, and specify that the script automatically executed by the pppd process after successful dialing is / tmp / .ip_up_wan2.sh, and the script automatically executed by the pppd process after the connection is disconnected is / tmp / .ip_down_wan2.sh;
[0159] Running / tmp / .ip_up_wan2.sh will use the IP corresponding to the network card ppp5002 obtained after successful dialing, as well as the IP of the VOIP server, to generate the policy routing table multi_wired_table_wan2, so as to realize that the VOIP service preferentially uses the network card ppp5002 corresponding to wan2;
[0160] Running / tmp / .ip_down_wan2.sh will clear and delete the policy routing table multi_wired_table_wan2.
[0161] 4. The actual actions of the wan3 script include:
[0162] Running the / tmp / .tmp_pppd_wan3.sh script will run a pppd process in the background for PPPoE dialing, and specify that the script automatically executed in the background by the pppd process after successful dialing is / tmp / .ip_up_wan3.sh, and the script automatically executed in the background by the pppd process after the connection is disconnected is / tmp / .ip_down_wan3.sh;
[0163] Running / tmp / .ip_up_wan3.sh will have the following actions:
[0164] a. Use the IP corresponding to the network card ppp5003 obtained after successful dialing, as well as the IP of L2TP server A and the IP of the WIFI bridge br1 to generate the policy routing table multi_wired_table_wan3 (including a static route for traffic to and from L2TP server A via the wan3 network card, i.e., ppp5003);
[0165] b. Enable the L2TP service and add a default route with the exit interface being the ppp0 network card and the next hop being the peer IP of the ppp0 network card to the policy routing table after successful connection. Thus, the terminal devices connected to the WIFI bridge br1 can remotely access the L2TP server A through the ppp0 network card.
[0166] Running / tmp / .ip_down_wan3.sh will clear and delete the policy routing table multi_wired_table_wan3.
[0167] 5. The actual actions of the wan4 script include:
[0168] Running the / tmp / .tmp_pppd_wan4.sh script will run a pppd process in the background for PPPoE dialing, and specify that the script automatically executed by the pppd process in the background after successful dialing is / tmp / .ip_up_wan4.sh, and the script automatically executed by the pppd process in the background after the connection is disconnected is / tmp / .ip_down_wan4.sh;
[0169] Running / tmp / .ip_up_wan4.sh will have the following actions:
[0170] a. Generate the policy routing table multi_wired_table_wan4 using the IP corresponding to the network card ppp5004 obtained after successful dialing, the IP of the L2TP server B, and the IP of the WIFI bridge br2 (including a static route for traffic to and from the L2TP server B via the wan4 network card, i.e., ppp5003);
[0171] b. Enable the L2TP service and add a default route with the exit interface being the ppp1 network card and the next hop being the peer IP of the ppp1 network card to the policy routing table after successful connection. Thus, the terminal devices connected to the WIFI secondary bridge br2 can remotely access the L2TP server B through the ppp1 network card;
[0172] Running / tmp / .ip_down_wan4.sh will clear and delete the policy routing table multi_wired_table_wan4.
[0173] 6. The actual actions of the wan5 script include:
[0174] Running the / tmp / .tmp_pppd_wan5.sh script will run a pppd process in the background for PPPoE dialing, and specify that the script automatically executed in the background by the pppd process after successful dialing is / tmp / .ip_up_wan5.sh, and the script automatically executed in the background by the pppd process after the connection is disconnected is / tmp / .ip_down_wan5.sh;
[0175] The following actions will occur when running / tmp / .ip_up_wan5.sh:
[0176] a. Generate a policy routing table multi_wired_table_wan5 using the IP corresponding to the network card ppp5005 obtained by successful dialing and the IP of the WIFI bridge br3. Thus, terminals connected under the WIFI bridge br3 can access the Internet through ppp5005.
[0177] Furthermore, it is judged whether the SIM card is inserted. If there is a SIM card, the mobile network is enabled to obtain the network card wan6, and a default route with the default gateway being wan6 is configured in the main routing table.
[0178] In this preferred embodiment, the present application realizes the efficient management of network interfaces and the optimized allocation of service traffic through an automated configuration management process. First, the system automatically runs the first configuration scripts for each wan port according to the preset configuration parameters. This step ensures that the network interfaces can be initialized according to the established service requirements and network conditions. Then, based on these first configuration scripts, the system obtains the configuration information of each network, which provides the necessary data support for subsequent network management and traffic control. Finally, using the obtained network configuration information, the system generates the corresponding policy routing tables and configures firewall rules, realizing the precise routing and security control of different service traffic. This coherent process not only improves the automation level of network configuration, reduces manual intervention, but also enhances the adaptability and response speed of the network to different service requirements, thereby improving the efficiency and security of the entire network. Through this automated and intelligent network management method, the present application effectively solves the problems of rigid network configuration, slow response, and low security in the prior art, and provides a more flexible, reliable, and secure network service for network operators and users.
[0179] The connection module 20 is also used to manage the routing and access permissions of each service traffic according to the respective policy routing tables and each firewall rule.
[0180] The disconnection module 30 is used to judge that if the connection state is disconnected, obtain the process identifiers of each network protocol client of the access method of each current wan port.
[0181] The disconnection module 30 is further configured to terminate the first process of each network protocol client process identifier and delete each first configuration script, each first process file, and the first IP configuration of each current WAN port of each network protocol client process identifier.
[0182] As a preferred embodiment of Embodiment 2, the terminating the first process of each network protocol client process identifier and deleting each first configuration script, each first process file, and the first IP configuration of each current WAN port of each network protocol client process identifier is specifically as follows:
[0183] If it is detected that the connection status of eth1 is disconnected, a disconnection handling operation is executed, specifically as follows:
[0184] 1. Handle wan0:
[0185] Read the file / tmp / .udhcpc_v4_wan0.pid to obtain the pid of the udhcpc process currently used by wan0, then kill the process according to the pid, then delete the corresponding execution script and the process pid file, and clear the IP of the eth1 network card.
[0186] 2. Handle wan1, read / tmp / .pppd_wan1_ppp.pid and / tmp / .udhcpc6_v6_wan1.pid to obtain the pids of the corresponding pppd and uhcpc6 processes, and kill the corresponding processes according to the pids.
[0187] 3. Handle wan2, same as wan1;
[0188] 4. Handle wan3, same as wan1;
[0189] 5. Handle wan4, same as wan1;
[0190] 6. Handle wan5, same as wan1.
[0191] As a preferred embodiment of Embodiment 2, it further includes:
[0192] If the relevant configuration parameters of one of wan1 - wan5 are updated, the corresponding disconnection handling operation is executed and then the new parameters are read to execute the connection operation.
[0193] Configuration parameters:
[0194] PPPoE parameter group: PPPoE switch (i.e., the switch of a certain WAN), account, password, MTU, L2TP parameter group: switch, server IP address, account, password, mtu;
[0195] 1. The wan1 parameter group includes the TR069 server address and the pppoe parameter group;
[0196] 2. The wan2 parameter group includes the VOIP server address and the pppoe parameter group;
[0197] 3. The wan3 parameter group includes the pppoe parameter group and the L2TP parameter group;
[0198] 4. The wan4 parameter group includes the pppoe parameter group and the L2TP parameter group;
[0199] 5. The wan5 parameter group includes the pppoe parameter group.
[0200] In this preferred embodiment, the present application significantly improves the flexibility and adaptability of network management by introducing a dynamic configuration update mechanism. First, the system can identify and respond to the configuration parameter update requirements of each wan port, which allows network administrators to adjust the configuration according to network changes or business needs to optimize network performance. Then, the system reads the new configuration parameters, which ensures that network devices can operate according to the latest settings and maintain the optimal state of the network. Subsequently, the system terminates the relevant network protocol client processes and deletes the old configuration scripts and IP configurations, which clears the outdated network settings and paves the way for the new configuration. Finally, the second configuration script is run according to the new configuration parameters, enabling network devices to quickly adapt to the new network environment and ensuring business continuity and network stability. In summary, through the automated configuration update process, the present application not only improves the network's response speed to changes but also enhances the network's manageability and reliability, solves the problem of cumbersome and time-consuming network configuration update processes in the prior art, and achieves fast iteration and precise control of network configurations.
[0201] This device uses three modules to divide the work and coordinate with each other to better manage the network interfaces. This application solves the problem in the prior art that multiple WAN access paths cannot be established using a single physical network interface by monitoring the connection status of the physical network interface and dynamically executing corresponding configuration scripts according to this status. When the connection status of the physical network interface is connected, the system automatically runs the configuration scripts of each WAN port according to preset parameters. These scripts can independently configure different access methods for each WAN port, thus realizing the establishment of multiple logical WAN links on a single physical network interface. Subsequently, the system generates corresponding policy routing tables and configures firewall rules to intelligently manage the routing and access permissions of different service traffic, ensuring that the traffic is transmitted through the correct WAN port. When the connection status is disconnected, the system quickly terminates the relevant network protocol client processes and clears the corresponding configurations and IP information to quickly release and reallocate network resources. This process not only improves the flexibility and reliability of the network, but also reduces manual intervention through automated management, solving the technical problem that a single physical network interface cannot support multiple WAN access paths simultaneously.
[0202] Embodiment 3:
[0203] An embodiment of this application provides a computer-readable storage medium, and the computer-readable storage medium includes a stored computer program. Among them, when the computer program runs, it controls the device where the computer-readable storage medium is located to execute the management method of a network interface described above;
[0204] Among them, for the management method of a network interface, if it is implemented in the form of a software functional unit and used as an independent product, it can be stored in a computer-readable storage medium. Based on such an understanding, to implement all or part of the processes in the above embodiment methods of the present invention, it can also be completed by a computer program instructing relevant hardware. The computer program can be stored in a computer-readable storage medium. When the computer program is executed by a processor, it can implement the steps of each of the above method embodiments. Among them, the computer program includes computer program code, and the computer program code can be in the form of source code, object code, executable file or some intermediate form, etc. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disc, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electrical carrier signal, telecommunication signal, and software distribution medium, etc.
[0205] Embodiment 4
[0206] The present application provides a terminal device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor. When the processor executes the computer program, it implements any one of the network interface management methods described in Embodiment 1.
[0207] In the above specific embodiments, the purpose, technical solution, and beneficial effects of the present invention have been further described in detail. It should be understood that the above are only specific embodiments of the present invention and are not used to limit the protection scope of the present invention. In particular, for those skilled in the art, any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A method for managing a network interface, characterized in that: include: Get the connection status of the preset physical network interface; If the connection state is connected, run the first configuration script of each wan port according to the preset configuration parameters; Generate each policy routing table and configure each firewall rule according to the first configuration script of each wan port; Manage the routing and access rights of each service flow according to each policy routing table and each firewall rule; If the connection state is disconnected, obtain each network protocol client process identifier of each current access mode of each wan port; The first process of each network protocol client process identifier is terminated and each first configuration script, each first process file and the first IP configuration of each current wan port of each network protocol client process identifier are deleted.
2. The method for managing a network interface according to claim 1, characterized in that: Also includes: Get the configuration parameter update requirements of each wan port; According to the configuration parameter update requirement, read each new configuration parameter; Terminate the second process of each network protocol client process identifier of each wan port and delete each second configuration script, each second process file and the current second IP configuration of each wan port of each network protocol client process identifier; According to the new configuration parameters, the second configuration script of each WAN port is run.
3. The method for managing a network interface according to claim 1, characterized in that: According to the preset configuration parameters, the first configuration script of each wan port is run; according to the first configuration script of each wan port, each policy routing table is generated and each firewall rule is configured, specifically: Run the first configuration script of each wan port according to the preset configuration parameters; According to the first configuration script, obtaining each configuration information of each network; According to the various network configuration information, various policy routing tables are generated and various firewall rules are configured.
4. The method for managing a network interface according to claim 1, characterized in that: According to the preset configuration parameters, the first configuration script of each wan port is run, specifically: Configure the PPPoE dial-up connection of each WAN port according to the preset PPPoE parameter group; Configure the L2TP connection of each WAN port according to the preset L2TP parameter group; According to the PPPoE dial-up connection of each wan port and the L2TP connection of each wan port, the first configuration script of each wan port is run.
5. The method for managing a network interface according to claim 1, characterized in that: The method of running the first configuration script of each wan port according to each preset configuration parameter also includes: Run the udhcpc application according to the preset DHCP configuration parameter script; Run the first configuration script for each wan port according to the IP address information obtained by the udhcpc application.
6. A network interface management device, characterized in that: It includes an acquisition module, a connection module and a disconnection module; The acquisition module is used to obtain the connection status of the preset physical network interface; The connection module is used to run the first configuration script of each wan port according to various preset configuration parameters if the connection state is connected; Generate each policy routing table and configure each firewall rule according to the first configuration script of each wan port; Manage the routing and access rights of each service flow according to each policy routing table and each firewall rule; The disconnection module is used to obtain the network protocol client process identifier of each current access mode of each wan port if the connection state is disconnected; The first process of each network protocol client process identifier is terminated and each first configuration script, each first process file and the first IP configuration of each current wan port of each network protocol client process identifier are deleted.
7. The network interface management device according to claim 6, characterized in that: Also includes: Get the configuration parameter update requirements of each wan port; According to the configuration parameter update requirement, read each new configuration parameter; Terminate the second process of each network protocol client process identifier of each wan port and delete each second configuration script, each second process file and the current second IP configuration of each wan port of each network protocol client process identifier; According to the new configuration parameters, the second configuration script of each WAN port is run.
8. The network interface management device according to claim 6, characterized in that: According to the preset configuration parameters, the first configuration script of each wan port is run; according to the first configuration script of each wan port, each policy routing table is generated and each firewall rule is configured, specifically: Run the first configuration script of each wan port according to the preset configuration parameters; According to the first configuration script, obtaining each configuration information of each network; According to the various network configuration information, various policy routing tables are generated and various firewall rules are configured.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored computer program, wherein when the computer program is executed, the device where the computer-readable storage medium is located is controlled to execute the network interface management method according to any one of claims 1 to 5.
10. A terminal device, characterized in that: The method comprises a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the network interface management method according to any one of claims 1 to 5 when executing the computer program.