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.

I recently installed Debian squeeze on my development machine every things went well i was able to connect to the Internet yesterday i moved my hard disk to another machine ,i can't able to connect to the Internet in Debian,but i can connect to it using Windows XP.

i tried the following commands but no use not working

/etc/init.d/networking restart
/var/log/syslog        doesn't show any error
ping www.google.com    results no host found

More details

ifconfig

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:39 errors:0 dropped:0 overruns:0 frame:0
      TX packets:39 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:13737 (13.4 KiB)  TX bytes:13737 (13.4 KiB)

netstat -rn

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface

cat /etc/resolv.conf

domain Home
search Home
nameserver 192.168.1.1
nameserver 192.168.1.1

/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

ifconfig -a

eth1  Link encap:Ethernet  HWaddr 6c:f0:49:f6:45:ae  
      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)
      Interrupt:26 Base address:0x6000 

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:70 errors:0 dropped:0 overruns:0 frame:0
      TX packets:70 errors:0 dropped:0 overruns:0 carrier:0
      collisions:0 txqueuelen:0 
      RX bytes:18029 (17.6 KiB)  TX bytes:18029 (17.6 KiB)
share|improve this question
1  
Can you post the output from netstat -rn, ifconfig, cat /etc/resolv.conf, anonymise any IP addresses if you wish, but please ensure they are consistent. –  EightBitTony May 14 '12 at 10:32
    
the contents of /etc/network/interfaces would also be useful –  stew May 14 '12 at 10:55
    
i added few details plz check it –  Gopi May 14 '12 at 11:34
    
Do any devices in LAN respond to ping, and if yes, does 8.8.8.8 respond to ping? –  Sašo May 14 '12 at 11:53
add comment

2 Answers

up vote 4 down vote accepted

Your /etc/network/interfaces is configured foreth0 however, you don't have an eth0 but an eth1.

udev tries to statically name the ethernet cards, by assigning a semi-permanent name to cards the first time they are seen. You can get rid of the 'reservation' of eth0 from your previous ethernet card by deleting the line from /etc/udev/rules.d/70-persistent-net.rules which ends with name=eth0 and the line which ends with name=eth1. Then upon the next reboot (or when you run udevadm trigger), your ethernet card will be assigned eth0 semi-permanently.

You can also change eth1 to eth0 temporarily by running ip link set name eth0 dev eth1, after which /etc/init.d/networking stop ; /etc/init.d/networking start should get you back on the network.

share|improve this answer
    
great stew it worked :) –  Gopi May 14 '12 at 12:18
add comment

Your description is not enough. You need to provide us with more information to help you better.

As a guess, I can say that your primary network interface has changed after moving the HD drive to another machine. So, you need to check the interface name using ifconfig -a. Then, you can edit the network interfaces configuration file /etc/network/interfaces to match the new name. When done, you can do /etc/init.d/networking restart.

share|improve this answer
    
i tried but not working –  Gopi May 14 '12 at 11:29
add comment

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.