CentOS8 set the bridge network mode, and configure static IP and external network access

Previously, when using the winSCP tool to remotely connect to Linux, it was unable to connect. After configuring the network connection to bridge mode, although the client can connect without pressure, a new problem has arisen, and Linux cannot access the external network.

First, we open the network adapter configuration in VMware, select the bridge mode, and apply.
Insert picture description hereAt this time, secureCRT, Xshell, and other command-line tools can connect to Linux, and WinScp and Xftp are no problem. If it is executed in the command line ping www.baidu.combut cannot be resolved, the external network is still disconnected.
Then, open the /etc/sysconfig/network-scriptsmount
Insert picture description hereright button through the winSCP tool -edit ifcfg-ens32 BOOTPROTO
Insert picture description here=static, set ip to static ip, ONBOOT=yes, and then set the ip address, mask, gateway, DNS and other information. The network segment of the ip address needs to be connected to the host Keep the same network segment, just keep the mask and gateway the same.
Finally, don't forget to click the save button in the upper left corner.
Use nmcli c reload +网卡名the restart card, this is centos8 the command mode, the way may not be the same as before, Baidu click on OK, and after executing the above command, secureCRT may be disconnected. The previous ip address was dynamic. After changing the configuration file and restarting the network, the ip address has changed and the connection host needs to be reset.
Finally, use the ip addrcommand to check whether the static ip we set is effective; use it to ping www.baidu.comsee if you can access the external network.
Insert picture description here

Guess you like

Origin blog.csdn.net/qq_41885819/article/details/107010240
Recommended