Hyper-v Linux 7.7 can't connect to local internet connection

Latest response

Recently set up a hyper-v vm with Linux 7.7 and I am having issues connecting to the internet. The virtual switch is connected and the wired ipv4 connection is configured correctly.

Both the eth0 and virbr0 devices are in a connected state according to the nmcli device status in terminal.

Any ideas?

Responses

Mark,

Some questions, bear with me even though you mentioned the connection is configured correctly, and perhaps this is all fine, but you are our eyes and ears for this, and we're not aware of the answers to these questions or if another person besides you perhaps set this up:

  • From your brief description, I imagine this system is a new system?
  • How was this system built, from a network kickstart? Was it built manually?
  • Did the system at one time have a network connection and then some change occurred and now it does not?
  • Is there any chance the network switch this is connected to is not the same VLAN or subnet for what you are attempting to use?
  • Is the port on the switch configured for network security and currently offline and require your network people to reactivate the port?
  • Try deactivating (temporarily) the firewall on the system in case ping is blocked, then re-try ping attempts.
  • Are you able to ping the gateway?
  • Is a gateway assigned to eth0? or to the system at all (see next line)
  • Does the output of netstat -rn command show a gateway with "UG" flag? see text block below
  • Are you 100% sure the proper subnet is presented to your hyper-v vm? (Do other systems on hyper-v use that subnet?)
  • Is the IP address static? If so, is the IPADDR=PROPER_IP_GOES_HERE set correctly in the ifcfg-eth0 file?
  • If it is DHCP, is BOOTPROTO=dhcp set? If not DHCP, is it set to static or none instead?
  • Is the gateway directive set in ifcfg-eth0 or /etc/sysconfig/network files?
  • Is your resolv.conf set correctly (if you do not have resolv.conf set, you can't use DNS)

EXAMPLE netstat -rn OUTPUT (I used "192.168.0" subnet, yours will probably be different).

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         192.168.0.1    0.0.0.0         UG        0 0          0 eth0
192.168.0.0    0.0.0.0         255.255.255.0   U         0 0          0 eth0

Regards

RJ

• From your brief description, I imagine this system is a new system? Yes this is a brand new linux 7.7 vm I built. • How was this system built, from a network kickstart? Was it built manually? It was built using hyper-v new virtual machine builder using rhel-server-7.7-x86_64-dvd.iso • Did the system at one time have a network connection and then some change occurred and now it does not? No, this is being set up for the first time. • Is there any chance the network switch this is connected to is not the same VLAN or subnet for what you are attempting to use? No, correct subnet mask is being used. • Is the port on the switch configured for network security and currently offline and require your network people to reactivate the port? No, the ports are all up. • Try deactivating (temporarily) the firewall on the system in case ping is blocked, then re-try ping attempts. All pings are going through. I can ping the server from the vm and the vm to the server successfully. • Are you able to ping the gateway? I am not getting when pinging the gateway from the vm terminal. • Is a gateway assigned to eth0? or to the system at all (see next line) • Does the output of netstat -rn command show a gateway with "UG" flag? see text block below Yes there is a UG flag for the gateway • Are you 100% sure the proper subnet is presented to your hyper-v vm? (Do other systems on hyper-v use that subnet?) Yes the correct subnet mask is presented. Yes others use the same one. • Is the IP address static? If so, is the IPADDR=PROPER_IP_GOES_HERE set correctly in the ifcfg-eth0 file? Trying to set the ifconfig eth0 and the netmask in terminal and I get a operation not permitted. • If it is DHCP, is BOOTPROTO=dhcp set? If not DHCP, is it set to static or none instead? I am not sure how to test this. • Is the gateway directive set in ifcfg-eth0 or /etc/sysconfig/network files? I am not sure how to test this. • Is your resolv.conf set correctly (if you do not have resolv.conf set, you can't use DNS) I am not sure how to test this.

• From your brief description, I imagine this system is a new system? Yes this is a brand new linux 7.7 vm I built. • How was this system built, from a network kickstart? Was it built manually? It was built using hyper-v new virtual machine builder using rhel-server-7.7-x86_64-dvd.iso • Did the system at one time have a network connection and then some change occurred and now it does not? No, this is being set up for the first time. • Is there any chance the network switch this is connected to is not the same VLAN or subnet for what you are attempting to use? No, correct subnet mask is being used. • Is the port on the switch configured for network security and currently offline and require your network people to reactivate the port? No, the ports are all up. • Try deactivating (temporarily) the firewall on the system in case ping is blocked, then re-try ping attempts. All pings are going through. I can ping the server from the vm and the vm to the server successfully. • Are you able to ping the gateway? I am not getting when pinging the gateway from the vm terminal. • Is a gateway assigned to eth0? or to the system at all (see next line) • Does the output of netstat -rn command show a gateway with "UG" flag? see text block below Yes there is a UG flag for the gateway • Are you 100% sure the proper subnet is presented to your hyper-v vm? (Do other systems on hyper-v use that subnet?) Yes the correct subnet mask is presented. Yes others use the same one. • Is the IP address static? If so, is the IPADDR=PROPER_IP_GOES_HERE set correctly in the ifcfg-eth0 file? Trying to set the ifconfig eth0 and the netmask in terminal and I get a operation not permitted. • If it is DHCP, is BOOTPROTO=dhcp set? If not DHCP, is it set to static or none instead? I am not sure how to test this. • Is the gateway directive set in ifcfg-eth0 or /etc/sysconfig/network files? I am not sure how to test this. • Is your resolv.conf set correctly (if you do not have resolv.conf set, you can't use DNS) I am not sure how to test this.

Hi Mark,

Dumb question maybe - did you select "automatically connect to the internet" during the installation process ?
The setting is a little bit hidden in the Anaconda installer. Sometimes the most easy things are the solution ... :)

Regards,
Christian

Does this require a re-install?

Hi Mark,

No, you can enable it in the network settings ... but if you have set a fresh headless server and
didn't configure too much already - it might be a good idea to reinstall with correct settings. :)

Regards,
Christian

What is the difference if me going into the wired settings and setting up the connections and selecting connect?

Hi Mark,

Unfortunately I don't have much experience with (latest) Hyper-V ... you may want to consider visiting Microsoft forums and search for a solution. All I know is, that it works correctly in KVM.

Cheers :)
Christian