2021-01-23

How to configure a static IP address when your Linux adapter is in bridge mode

1. ip route queries your default gateway (needed in the second step configuration file below)
The IP address in the line containing the default keyword is the default gateway of your network card

  1. Change the IP configuration file cd /etc/sysconfig/ifcfg-scripts
    The explanation in the detailed configuration file is shown in the figure below:
    The meaning of each item in the configuration file

  2. Refresh service: systemctl restart NetworkManager or service NetworkManager restart (this is a centos8 command)

  3. ifup interface name such as: ifup ens38

  4. ip route Check whether the IP address you configured has been added to the network card

Guess you like

Origin blog.csdn.net/solving/article/details/113063713