mac + virtualbox + centos7 virtual machine network

mac + virtualbox + centos7 virtual machine network

2018.11.30 21:16:36 319 read 2,287 words

linux version used herein is centos7, corresponding virtualbox version 5.1.6

1, into the virtualbox -> Preferences

 
1

2, switch to the network Tab pages, a new network NAT

 
2

In the new NAT network above right click and select Edit, and note the gateway address

Here the gateway address is 10.0.2.0

 
2.2

3, change the virtual machine's network settings, and select just the new NAT network

 
3

After setting need to restart the virtual machine

4, restart the virtual machine, enter modify the network card settings

Administrator user to enter / etc / sysconfig / network-scripts directory, you can see a ifcfg-xxx file. Where xxx is the name of the network card, different on each machine. Edit this file, you need to modify the content as follows:

BOOTPROTO = static # dhcp changed from static

IPONBOOT = yes # # Set boot automatically take effect for the following new

IPADDR = 10.0.2.8 # 10.0.2.x again in this segment to set a static IP for your own virtual machine

GATEWAY=10.0.2.1

NETMASK=255.255.255.0

DNS1=10.0.2.1

After completing the editing save and exit and restart network services:

service network restart

5, complete the configuration

At this point you can see the IP of the machine through the command ip addr address

Guess you like

Origin www.cnblogs.com/zafu/p/12162412.html