JAVA obtains network card information and default gateway (Linux CentOS7 multi-network card)
Existing requirements: The web page can obtain the network card information and the default gateway, and the network card can be configured through the web page.
1. Prepare the required LINUX commands
2. Execute commands through RUNTIME
The above code obtains the set of network card names, and then obtains the details of the network card through the ifconfig xxx command.
3. Processing results
4. Get the default gateway (static route)
5. Test it
6. Anyway, various commands can be executed through RUNTIME, and then the processing result is connected, and it is grieving to deal with it. I don't know if there is a better way.
7. Modify the network card configuration:
JAVA modify the network card configuration (Linux CentOS7 multi-network card)