Hyper-v linux disposed fixed ip

First, create a dedicated virtual switch CentOS 7

Hyper-v Open the Control Panel, find the right "Virtual Switch Manager"

Inside, click on "New virtual network switch", fill out name, select the "internal"

Open network center, modifying the configuration as shown below, note ip address random packing, in the form of "192.168.xxx.xxx", fixed Subnet Mask "255.255.255.0"

Second, the configuration is fixed inside CentOS 7 ip

Right "connection" CentOS 7

After you enter the account password, enter the following command

$ cd /etc/sysconfig/network-scripts

Then enter the command file $ ls view folders, as

To modify a file is named "ifcgf-eth0", enter the command $ vi ifcfg-eth0, modify the contents of the file as shown, place emphasis modify the selected red box

After saving Logout, restart the execution commands for network services

$ systemctl restart network

ping the fixed ip just set a good try

Successful, but this time we want to access the Internet does not work, do not believe you can try ping www.baidu.com

So, in order to access the Internet, we need to do a little modification, back windows, enter the network Sharing Center, find the "Ethernet", amend the following figure

 

 After changing for the better, the next reboot the network again, and then execute $ systemctl restart network ping www.baidu.com

At this point, fixed ip has been configured.

 

Guess you like

Origin www.cnblogs.com/luoocean/p/11101401.html