Définition de la passerelle par défaut ou ajout d'une route statique
Cette section décrit comment définir la passerelle par défaut ou ajouter une route statique.
Procédure
Connectez-vous au système d'exploitation en tant qu'utilisateur root .
Cliquez avec le bouton droit sur le bureau et choisissez Ouvrir dans le terminal dans le menu contextuel pour accéder à l'interface de ligne de commande.
Exécutez la commande cd software-installation-path/engineering/tools pour accéder au répertoire.
Le répertoire par défaut est /opt/huawei/LogCenter/engineering/tools.
Exécutez la commande ./config_network.sh pour définir la passerelle par défaut ou ajoutez une route statique lorsque vous y êtes invité.
La configuration prend effet immédiatement sans redémarrage du serveur.
Configurez la passerelle par défaut.
LogServer:/opt/huawei/LogCenter/engineering/tools # ./config_network.sh Which operation do you want to execute? 1) Change the IP address. 5) Modify the database. 2) Delete the IP address. 6) Change the web port. 3) Set the gateway. 7) Exit 4) Configure DNS. #? 3 Which operation do you want to execute? 1) Change the system default gateway. 2) Add route. #? 1 Info: You chosed to change the system default gateway. Info: Enter the new IP address: 192.168.104.1 Info: Succeeded in changing the system default gateway to 192.168.104.1.
Ajoutez une route statique.
LogServer:/opt/huawei/LogCenter/engineering/tools # ./config_network.sh Which operation do you want to execute? 1) Change the IP address. 5) Modify the database. 2) Delete the IP address. 6) Change the web port. 3) Set the gateway. 7) Exit 4) Configure DNS. #? 3 Which operation do you want to execute? 1) Change the system default gateway. 2) Add route. #? 2 For which network interface do you want to add the route? 1) eth0 2) eth1 #? 2 Info: Enter the ip address for destination network, like X.X.X.X/X: 192.168.0.0/16 Info: Enter the gateway address: 192.168.1.1 Info: Succeeded in setting the route to 192.168.0.0/16 via 192.168.1.0.