Objective
For a long time without Linux a sudden review of a face, a lot of things are forgotten, so this blog simple record in the VirtualBox virtual machine, Linux CentOS 7 How to set up to even the extranet. Previously wrote a blog record such a problem: VirtualBox dual network card to achieve the virtual machine Linux CentOS 7 Internet access and host visits, here is still using the mode of this dual network card division of labor, host-only network card to achieve the host exchange, through the NAT network cards connected to the net, The only point to note is that thegateway in the NAT Nic's configuration file is consistent with the host's gateway. Be consistent. Consistent. All right, important details are over. Set NAT Gateway
First look at the host gateway, you can see 192.168.0.254:
Next, locate the NAT gateway configuration file in the virtual machine, as shown in the following red-flagged file:
Then open the file, focus on the Gateway (Gatewat), you can see the same as our host gateway (if the inconsistency is modified to consistent):
Finally, enter the command to restart the Linux Network Service: Servicenetwork Restart
Finally check to see if you can ping the extranet:
Can see basically no problem, is the speed is not too good lead to a small number of packet loss, the same in the browser can also be normal access:
Finally, incidentally, some common file paths and commands are recorded to prevent me from having a look again after a long time. related path and command Memo Linux network profile path: CD etc/sysconfig/network-scripts/linux Network SERVICE Command:
Start: Service network start off: Service Network stop restart: Service network Restart View routing status: Route summary
Simply record a small problem and hope to help a friend with the same problem, the end.