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

I've configured a CentOS 6.4 server as a KVM host running multiple VMs. VMs running on this KVM host are fine. The problem is: the host itself cannot connect to the Internet.

External addresses respond to ping, but external domain names fail to resolve (internal names resolve fine). Both interfaces have DNS servers specified, and those servers are reachable (respond to ping).

Host OS:

$ cat /etc/redhat-release 
CentOS release 6.4 (Final)

The VMs are configured to share a bridged network interface br0 that is bridged to eth0 on the host machine. There is another NIC (eth1), also bridged (br1), that is not currently in use.

Interface:

$ vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="5C:F3:FC:E3:7C:80"
ONBOOT="yes"
BRIDGE=br0
NM_CONTROLLED="no"
DNS1=10.0.0.11
DNS2=10.0.0.138
DOMAIN=[REDACTED]
TYPE=Ethernet

Bridge:

$ vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
TYPE=Bridge
BOOTPROTO=static
ONBOOT=yes
IPADDR=10.0.0.18
NETMASK=255.255.255.0
DELAY=0
GATEWAY=10.0.0.138
STP=on
DNS1=10.0.0.11
DNS2=10.0.0.138

I've done some troubleshooting myself, but to no avail. Find below some troubleshooting info:

ifconfig:

$ ifconfig
br0       Link encap:Ethernet  HWaddr 5C:F3:FC:E3:7C:80  
          inet addr:10.0.0.18  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::5ef3:fcff:fee3:7c80/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:68525 errors:0 dropped:0 overruns:0 frame:0
          TX packets:25810 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3761359 (3.5 MiB)  TX bytes:68108886 (64.9 MiB)

br1       Link encap:Ethernet  HWaddr 00:1B:21:C5:65:A3  
          inet6 addr: fe80::21b:21ff:fec5:65a3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:0 (0.0 b)  TX bytes:578 (578.0 b)

eth0      Link encap:Ethernet  HWaddr 5C:F3:FC:E3:7C:80  
          inet6 addr: fe80::5ef3:fcff:fee3:7c80/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:72703 errors:0 dropped:0 overruns:0 frame:0
          TX packets:65806 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6750000 (6.4 MiB)  TX bytes:70637683 (67.3 MiB)

eth1      Link encap:Ethernet  HWaddr 5C:F3:FC:E3:7C:82  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:24 errors:0 dropped:0 overruns:0 frame:0
          TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1440 (1.4 KiB)  TX bytes:1440 (1.4 KiB)

IP Routing Table:

$ netstat -rn
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 br0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 br0
169.254.0.0     0.0.0.0         255.255.0.0     U         0 0          0 br1
0.0.0.0         10.0.0.138      0.0.0.0         UG        0 0          0 br0

Firewall rules:

$ sudo iptables -nL
Chain INPUT (policy ACCEPT)
target     prot opt source               destination         
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpt:5905 
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED 
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           
ACCEPT     tcp  --  0.0.0.0/0            0.0.0.0/0           state NEW tcp dpt:22 
REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         
REJECT     all  --  0.0.0.0/0            0.0.0.0/0           reject-with icmp-host-prohibited 

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination   
share|improve this question
1  
What happens when you try to "connect to Internet"? –  Michael Hampton Jun 5 at 13:24
    
@MichaelHampton The machine is able to ping out to external addresses (e.g. 8.8.8.8) but not domain names (e.g. www.google.com), so it seems that this issue is not a network issue but rather a DNS one. Both interfaces have DNS servers specified, and both servers are present in /etc/resolv.conf and respond to pings, so I am at a loss for what is causing the issue. –  Taylor Hx Jun 12 at 6:33
    
what happens when you actually try to resolve an external hostame, e.g.use dig or nslookup? –  dyasny Jun 12 at 6:57
    
@dyasny Unfortunately, this machine does not have bind-utils installed and without being able to resolve hostnames I can't use yum to install the required packages. –  Taylor Hx Jun 12 at 7:48
    
Check the listed DNS servers, then, and make sure they are valid. If not, change them. –  Michael Hampton Jun 12 at 14:02

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.