Installing CentOS in VirtualBox enables normal connections between ssh and the external network

First, the network card mode selection

Network card 1: Host-only
is used for mutual access between the host and host. This is the communication between the host and the host through the network of 192.168.56.X. Whether the host can access the Internet does not affect the communication between the two parties
. Network card 2: The NAT
host uses this network card to pass the host. go online

Two, concrete arrangement

  1. Modify the /etc/sysconfig/network-scripts/ifcfg-eth0 file to configure the Host-only network:

  2. Modify the ifcfg-eth1 file and configure the NAT network:

  3. Restart the network
    Under the host machine: /etc/init.d/network restart
    ping Under the baidu.com
    host: ping 192.168.56.110

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325328760&siteId=291194637