Page 1 of 1

Centos-HyperV Networking for begginers

Posted: 2019/05/29 18:18:58
by gr33n
Hi, I am new in Linux world, so I believe this is simple question...
Here it is:
I have installed Centos 7.6.1810 on HyperV on my Windows 10 PC.
I would like to set networking on it. I am unable to set network so that machine will be visible from my PC.
Here is the result of ip a command:
Capture.PNG
Capture.PNG (11.18 KiB) Viewed 8734 times

On HyperV settings of virtual machine, Default Switch is selected as Virtual Switch

Can you help me how to set up network?

Re: Centos-HyperV Networking for begginers

Posted: 2019/05/29 20:06:41
by TrevorH
Post the contents of the file /etc/sysconfig/network-scripts/ifcfg-eth0

Re: Centos-HyperV Networking for begginers

Posted: 2019/05/29 20:33:23
by gr33n
Here it is:

Re: Centos-HyperV Networking for begginers

Posted: 2019/05/29 21:47:09
by TrevorH
Several problems with that: first if you want to use a static ip address, you will want BOOTPROTO=none not =dhcp. Next you cannot have a gateway ip of 255.255.255.0, that needs to point to your router (or the hyper-v host perhaps).

Depending on what network mode you chose for this guest on the host, you may need to use DHCP to get an ip address from the host. If you set it up in what would be known as bridged mode in vmware or kvm (no idea about hyper-v) then you can use a static ip within the same subnet as your host.

Re: Centos-HyperV Networking for begginers

Posted: 2019/05/30 19:54:46
by gr33n
Thank you TrevorH
I have set up file like this and it works:
Capture.PNG
Capture.PNG (11.87 KiB) Viewed 8680 times