Centos-HyperV Networking for begginers

Issues related to configuring your network
Post Reply
gr33n
Posts: 3
Joined: 2019/05/29 18:02:15

Centos-HyperV Networking for begginers

Post by gr33n » 2019/05/29 18:18:58

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 333 times

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

Can you help me how to set up network?

User avatar
TrevorH
Forum Moderator
Posts: 25810
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos-HyperV Networking for begginers

Post by TrevorH » 2019/05/29 20:06:41

Post the contents of the file /etc/sysconfig/network-scripts/ifcfg-eth0
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

gr33n
Posts: 3
Joined: 2019/05/29 18:02:15

Re: Centos-HyperV Networking for begginers

Post by gr33n » 2019/05/29 20:33:23

Here it is:
Attachments
Capture1.PNG
Capture1.PNG (8.21 KiB) Viewed 325 times

User avatar
TrevorH
Forum Moderator
Posts: 25810
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Centos-HyperV Networking for begginers

Post by TrevorH » 2019/05/29 21:47:09

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.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

gr33n
Posts: 3
Joined: 2019/05/29 18:02:15

Re: Centos-HyperV Networking for begginers

Post by gr33n » 2019/05/30 19:54:46

Thank you TrevorH
I have set up file like this and it works:
Capture.PNG
Capture.PNG (11.87 KiB) Viewed 279 times

Post Reply