[Wylug-help] Starting a network connection

Shaun Laughey shaun at laughey.com
Sun Jul 15 22:47:43 BST 2007


On Sun, 2007-07-15 at 22:01 +0100, john at bopa.co.uk wrote:
> I'm in a sticky situation having booted up from a Linux SystemRecueCD on laptop which has a dodgy disk, which I can't reboot for fear of losing data.
> 
> I need to copy some data onto my lan but am unsure of how to get the network started. Do I need to enable the lan port before I use it? And is there any way to tell if it is enabled in the BIOS? 
> 
> I've run ifconfig eth0 192.168.1.5 netmask 255.255.255.0 but can't ping anything else on the network.
> 
> 
> Any help would be appreciated.
> _______________________________________________
> Wylug-help mailing list
> Wylug-help at wylug.org.uk
> https://mailman.lug.org.uk/mailman/listinfo/wylug-help


EEK. Don't panic.

Try (as root)

ifup eth0

or

ifconfig eth0 up

or

ip link set eth0 up


The last one is the new latest way of doing stuff (tm).

Here is some stuff below about how ifconfig behaves on my own system and
most other modern Linux based systems to help you diagnose what you are
seeing with your own.

Firstly you wouldn't generally have an ifconfig for anything if it's not
working - the eth0 name is set when the modules are inserted on boot
generally.

e.g.

sudo ifconfig eth0 192.168.1.100
SIOCSIFADDR: No such device
eth0: ERROR while getting interface flags: No such device


Here is the output on my main desktop machine with 3 network ports
running on Ubuntu Feisty - ( kernel 2.6.16 ) with 2 built in gigabits
and one trusty Intel E100 PCI card.

I have removed my E100 and rebooted and when I do an ifconfig -a.

eth1      Link encap:Ethernet  HWaddr 00:80:08:73:55:37
          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)
          Interrupt:5 Base address:0x2000

eth2      Link encap:Ethernet  HWaddr 00:80:08:73:55:38
          inet addr:192.168.0.103  Bcast:192.168.0.255
Mask:255.255.255.0
          inet6 addr: fe80::250:8dff:fe93:1929/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:9779 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6611 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7953433 (7.5 MiB)  TX bytes:845569 (825.7 KiB)
          Interrupt:7 Base address:0xe000

As you can see eth1 says UP BROADCAST etc as it exists but its not
RUNNING which eth2 is.

Here eth0 has vanished (it was my trusty intel card) and I am left with
the unconnected eth1 and the connected eth2.

If I do:

ifconfig eth0

eth0: error fetching interface information: Device not found.

The fact you didn't get an error when setting the IP address could be
taken as good news.

The un-pinging could be arp related. If you haven't set the netmask
right or the IP address correctly. 

If could be firewall related - try telnet'ing to the other system on a
known open port e.g.

telnet myrouter 80
Trying myrouter....
Connected to myrouter
Escape character is '^]'.

As for DHCP - I find that a stale DHCP file or two can cause problems so
I usually do a

sudo killall dhclient

and then a dhclient eth0

If you are still unable to get the interface working look at 

/var/log/messages for errors re: network card - 

look at lsmod for the modules in question, my built in gigabit cards
used the forcedeth module so I can quickly see if the module is loading.
If it isn't I can find out why by manually inserting the module with
modprobe.

Look at dmesg for errors relating to the network card.

e.g. an error from my unconnected interface produces
ADDRCONF(NETDEV_UP): eth1: link is not ready

And as with all things network related always assume it's the cable
first.

Shaun Laughey.






More information about the Wylug-help mailing list