Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Problem

Cannot access the internet. CentOS guest isn't receiving incoming traffic.

Private network is fully accessible.

Scratching my head here... I don't have this problem on Debian/Ubuntu/Windows! :(

Configuration:

  • Hyper-V host (192.168.137.1)
  • Freshly built CEntOS guest (192.168.137.16)
  • Guest resides on Internal Network with Internet Connection Sharing(ICS) enabled
  • Address is assigned by DHCP server on the host
  • Address range: 192.168.137.0/24
  • DNS is set to my ISP's public nameservers (resolv.internode.on.net)

Additional Configuration

  • iptables is stopped
  • SELinux is disabled

Some info that may be useful

ifconfig

eth0      Link encap:Ethernet  HWaddr 00:15:5D:C8:34:5A
          inet addr:192.168.137.16  Bcast:192.168.137.255  Mask:255.255.255.0
          inet6 addr: fe80::215:5dff:fec8:345a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:111 errors:0 dropped:0 overruns:0 frame:0
          TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:12748 (12.4 KiB)  TX bytes:1788 (1.7 KiB)

eth1      Link encap:Ethernet  HWaddr 00:15:5D:C8:34:5C
          inet addr:192.168.137.15  Bcast:192.168.137.255  Mask:255.255.255.0
          inet6 addr: fe80::215:5dff:fec8:345c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:147 errors:0 dropped:0 overruns:0 frame:0
          TX packets:117 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:14087 (13.7 KiB)  TX bytes:14587 (14.2 KiB)
          Interrupt:9 Base address:0x2000

netstat -rn

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
192.168.137.0   0.0.0.0         255.255.255.0   U         0 0          0 eth0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 eth0
0.0.0.0         192.168.137.1   0.0.0.0         UG        0 0          0 eth0

cat /etc/resolv.conf

; generated by /sbin/dhclient-script
nameserver 192.231.203.132
nameserver 192.231.203.3

cat /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0
HWADDR=00:15:5D:C8:34:5A
TYPE=Ethernet
UUID=b4fefb4d-1d42-4a28-84b3-9a70b6ea65ca
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp

cat /etc/sysconfig/network

NETWORKING=yes
HOSTNAME=puppet-free.vm.pe
GATEWAY=192.168.137.1

cat /etc/udev/rules.d/70-persistent-net-rules

# net device ()
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:c8:34:5a", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x1011:0x0009 (tulip)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:5d:c8:34:5c", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

Questions I've already looked at to answer my own (in vain)

Unable to ping or access internet

Connect to the internet with CENTOS 5

Centos internet not working

My CentOS 5.7 server can't access the internet

share|improve this question
    
Painfully obvious question, but when you say incoming traffic, I assume you have started the original connection rather than a new incoming connection coming in? –  Matthew Ife Mar 12 at 18:58
    
Example: I try yum update, dns requests go out, nothing comes back, yum keeps retrying in vain. So... yes, I think. –  Vasili Syrakis Mar 12 at 20:36
    
How did you configure the Hyper-V virtual switch? –  Michael Hampton Mar 12 at 22:23

3 Answers 3

Can machine with IP address 192.168.137.1 forward traffic from network 192.168.137.0/24 to the internet?

If this machine is Linux, it has to have allow forwarding, try to see /etc/sysctl.conf file.

On routing machine can be denied forwarding by iptables (try exec iptables -L -n and check rules in the FORWARD chain).

You can try to install tshark (or tcpdump or tethereal) utility even on the new host even on the routing machine and watch packets. Then you can on the new machine exec ping 4.4.4.4, for example, and you will see, if router can forward packet to the next hop correctly.

If you have another router in the network: know this another router, that your first router (with one of IP address 192.168.137.1) routing this network? Try to check it by running command ping 192.168.137.1 on this next router (preferably border router). If this ping don't work, you have to set static route, somethink like this: ip route add 192.168.137.0/24 via x.x.x.x, where x.x.x.x is IP address of router, which have as another address 192.168.137.1.

I'm very sory about my English, but I believe, that this post can help to you...

share|improve this answer
    
The Hyper-V host is 192.168.137.1 and can forward traffic to and from the internet. Each machine on the 192.168.137.0/24 network can communicate with each other without a problem. What do I look for inside the sysctl.conf file? –  Vasili Syrakis Mar 12 at 8:07
    
You have to have in this file somethink like net.ipv4.ip_forward=1 (it's depend on the version of kernel). –  Jan Marek Mar 12 at 8:43
    
I edited my sysctl.conf and it did not seem to change anything. I checked on wireshark and it looks like the guest can send traffic outgoing, but nothing comes back. iptables is disabled. –  Vasili Syrakis Mar 12 at 11:12

I think your problem lies with your VM Guest configuration in Hyper-V, and not the OS itself. I'm no expert - but i vaguely recall similar problems a long time ago that were related to which type of virtualized network interface I had selected in my HyperV configuration.

The solution for me was to remove the network adapter configured by default, and add a 'Legacy Network' adapter. After that it seemed to work.

share|improve this answer
up vote 0 down vote accepted

Fixed!

Okay, so I found out what it was.

I do not expect anyone to ever have guessed this!

I have two network adapters:

  • 1x Ethernet Network Adapter - 192.168.1.13
  • 1x Wireless Adapter - 192.168.1.3

The Hyper-V Internal network was running on the Wireless Adapter with Internet Connection Sharing (ICS) enabled.

Packets were successfully going out, but upon coming back in they would go to my Ethernet card and they would have no clue where to go from there, hence, my VMs did not receive anything back.

I've now split my network in two, so I have my Wireless card on 192.168.1.0/24 and my Ethernet card on 10.1.1.0/24.

This configuration now works.

Hurrah!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.