Virtualbox has three modes, they are bridge mode, NAT mode and host-only mode.
The bridge mode is an address segment with the local network card, which directly uses the physical network card of the host.
The host-only mode depends on the settings in the virtualbox and can only communicate with the host and other VMs of host-only mode , and cannot communicate with the outside.
The NAT mode depends on the settings in the virtualbox. Its function is address translation. It is an address translation through the physical NIC of the host, and then it can be connected to the external network.
We can choose a mode according to our own needs.
If we need to automatically assign IP, then change booproto to DHCP, NAT mode and host mode will automatically get IP.
If we want to set it manually, the IP address of the bridge mode is set on the same network segment as the address of the host NIC. The netmask and gateway are the same as the host NIC settings.
Manually set the IP address of the NAT mode, first check the IP address of the NAT setting in the virtualbox, and then set it according to the corresponding address.
Manually set the IP of the host-only mode, first check the IP address of host-only mode setting in the virtualbox, and then set it according to the corresponding address.
Automatically:
BOOPROTO=DHCP (automatically)
Manually:
IPADDR = the IP of redhat vm
BOOPROTO= STATIX (manually)
NETMASK= the netmask of redhat vm
GATEWAY= the gateway of redhat vm
After the entire configuration is complete, save the configuration and restart the network service to take effect.
In addition, I search an instance that we can refer:
Setup static IP in redhat 6