You are not logged in.

#1 2009-11-17 13:15:46

halun
Member
From: Linköping, Sweden
Registered: 2008-03-30
Posts: 6
Website

Wired network problem: "carrier lost" immediately after getting IP

My first post here! I hope I'll not commit any serious blunders...

Anyway, here's my problem. I'm running Arch64 on a Lenovo Thinkpad X200s. Usually the wired network connection works flawlessly; just "netcfg wired", where the "wired" config file is a copy of /etc/network.d/examples/ethernet-dhcp. However, at the moment (and for the next two weeks) I'm staying at a hotel which seems to have a really strange network setup. I stayed there last year too, and had all kinds of weird problems with another computer.

What happens at the hotel is that I obtain an IP address with DHCP, and then the connection is lost almost immediately. There is a short time interval (less than a second) where I can, for example, load a web page. (Before I try to connect, I type in the address of a fast-loading site like www.google.com in Firefox, and of course I get an error message about being unable to load the page. Then I start the DHCP client in a terminal window, and while it is trying to connect I keep pressing the reload button in Firefox repeatedly. After a while, the page loads successfully. I never see the login page that's supposed to come up first. But if I try to reload again after a few seconds, there is again an error message.)

Luckily, during the day I'm in an office where the connection works as it should. Otherwise, I don't think I would have been able to post this...

---

Here are the details. First attempt:

[root@fjodor hans]# netcfg wired
:: wired up                                                              [BUSY] dhcpcd: eth0: MTU restored to 1500
dhcpcd: timed out
 - DHCP IP lease attempt failed.

Not very useful. Next, try dhcpcd manually:

[root@fjodor hans]# dhcpcd -B eth0
dhcpcd: version 5.1.3 starting
dhcpcd: eth0: rebinding lease of 192.168.1.71
dhcpcd: eth0: acknowledged 192.168.1.71 from 192.168.1.1 `ÿ'
dhcpcd: eth0: checking for 192.168.1.71
dhcpcd: eth0: carrier lost
dhcpcd: eth0: MTU restored to 1500
dhcpcd: eth0: carrier acquired
dhcpcd: eth0: rebinding lease of 192.168.1.71
dhcpcd: eth0: acknowledged 192.168.1.71 from 192.168.1.1 `ÿ'
dhcpcd: eth0: checking for 192.168.1.71
dhcpcd: eth0: leased 192.168.1.71 for 86400 seconds
dhcpcd: eth0: MTU set to 576
dhcpcd: eth0: carrier lost
dhcpcd: eth0: carrier acquired
dhcpcd: eth0: rebinding lease of 192.168.1.71
^Cdhcpcd: received SIGINT, stopping
dhcpcd: eth0: removing interface

Sometimes the following message also appears in the midst of everything:

cat: /var/run/dhcpcd/resolv.conf.eth0: No such file or directory

The thread http://bbs.archlinux.org/viewtopic.php?id=79923 suggests using dhclient instead, so let's try that:

[root@fjodor hans]# dhclient eth0
Internet Systems Consortium DHCP Client V3.1.2p1
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/

can't create /var/state/dhcp/dhclient.leases: No such file or directory
Listening on LPF/eth0/00:1f:16:1e:01:ae
Sending on   LPF/eth0/00:1f:16:1e:01:ae
Sending on   Socket/fallback
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 6
DHCPOFFER from 192.168.1.1
DHCPREQUEST on eth0 to 255.255.255.255 port 67
DHCPACK from 192.168.1.1
can't create /var/state/dhcp/dhclient.leases: No such file or directory
bound to 192.168.1.71 -- renewal in 36192 seconds.

Well, it looks good, but no connection (except for that half second):

[root@fjodor hans]# ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:1F:16:1E:01:AE  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:107331 errors:0 dropped:0 overruns:0 frame:0
          TX packets:30444 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:38226834 (36.4 Mb)  TX bytes:4886661 (4.6 Mb)
          Memory:f2600000-f2620000 
[hans@fjodor ~]$ ping 192.168.1.1
connect: Network is unreachable

If I run dhclient in one terminal window, and meanwhile ping repeatedly in another, I get

[hans@fjodor ~]$ ping 192.168.1.1
connect: Network is unreachable
[hans@fjodor ~]$ ping 192.168.1.1
connect: Network is unreachable
[hans@fjodor ~]$ ping 192.168.1.1
connect: Network is unreachable
[hans@fjodor ~]$ ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=6.55 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=2.20 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=2.08 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=4.00 ms
64 bytes from 192.168.1.1: icmp_seq=5 ttl=64 time=2.20 ms
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
ping: sendmsg: Network is unreachable
^C
--- 192.168.1.1 ping statistics ---
13 packets transmitted, 5 received, 61% packet loss, time 12016ms
rtt min/avg/max/mdev = 2.086/3.410/6.551/1.725 ms

By the way, the error message "can't create /var/state/dhcp/dhclient.leases: No such file or directory" above seems strange. Is this a bug? According to the man page, the default file is /var/lib/dhclient/dhclient.leases. If I try "dhclient -lf /var/lib/dhclient/dhclient.leases eth0", then it creates the log file

lease {
  interface "eth0";
  fixed-address 192.168.1.71;
  option subnet-mask 255.255.255.0;
  option routers 192.168.1.1;
  option dhcp-lease-time 86400;
  option dhcp-option-overload 3;
  option dhcp-message-type 5;
  option domain-name-servers 192.168.1.1;
  option dhcp-server-identifier 192.168.1.1;
  option broadcast-address 255.255.255.255;
  renew 2 2009/11/17 07:18:59;
  rebind 2 2009/11/17 18:20:28;
  expire 2 2009/11/17 21:20:28;
}

but the connection is still dropped immediately, just like before.

I talked to the hotel manager, and he was very surprised that I was having trouble, because the network was working on the computer in his office, and apparently also for the other guests.

[I don't know if it's relevant, but the problems I had last year had to do with the login system. The normal procedure was that one had to start a web browser and enter user id and password on a login page before one could start browsing. However, this only applied to http connections. I could use ssh and https even when (as usually happened during the weekends...) the server that was handling the login was down.]

I know next to nothing about what's going on under the hood with all this DHCP stuff, so I have no clue what to try next. Any suggestions?

Offline

#2 2009-12-23 08:04:15

jcolinzheng
Member
From: Cambridge, MA
Registered: 2008-08-06
Posts: 50
Website

Re: Wired network problem: "carrier lost" immediately after getting IP

Offline

#3 2009-12-24 18:21:28

halun
Member
From: Linköping, Sweden
Registered: 2008-03-30
Posts: 6
Website

Re: Wired network problem: "carrier lost" immediately after getting IP

I'm not able to try it out, since I've left the hotel already. But thanks for the tip anyway!

Offline

Board footer

Powered by FluxBB