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 8727 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
Site Admin
Posts: 33202
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
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
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 8719 times

User avatar
TrevorH
Site Admin
Posts: 33202
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.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
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 8673 times

Post Reply