JAVA modify the default routing configuration (Linux CentOS7 multi-network card)
Existing requirements:
modify the default gateway, the default gateway device, take effect immediately, and take effect permanently.
Start to work
Since it is to take effect permanently, first exclude the route add command, you can modify the content of the /etc/sysconfig/network configuration file, and restart the network for implementation.
After the test is indeed possible, then open the whole.
have a test
The network card in my environment enp24s0f1 is configured with an IP of 192.168.113.111, and the default routing network card currently used is enp24s0f0, and the IP is 192.168.113.104.
After the change, I found that 104 is not working, and 111 is OK, and it's done.
As for the network card configuration
JAVA modify the network card configuration (Linux CentOS7 multi-network card)
query the network card configuration
JAVA to obtain the network card information and default gateway (Linux)