You are not logged in.

#1 2005-04-21 14:18:42

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

dhcp and pcmcia NIC startup (SOLVED)

Hello;

I'm pretty impressed with Arch up to now, but am having a problem with the pcmcia NIC. I'm sure it's some simple config problem, but I haven't been able to figure it out.

I'm using a Network Everywhere NP100, which uses the axnet driver. No problems there. I have it set as eth0="dhcp".

It works fine, but when I restart the box, or start up from a cold start, dhcp isn't assigning an IP, and during boot, network fails on start. After the box is up and running, I have to remove the card from the slot and reinsert it to get dhcp to assign an IP.

I haven't seen this problem with other distros, so I know it can be fixed, not not sure how. Below is my rc.conf, maybe somebody can spot something I'm missing?

HARDWARECLOCK="UTC"
TIMEZONE=EST5EDT
KEYMAP=us
CONSOLEFONT=
USECOLOR="yes"

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

#
# Networking
#
HOSTNAME="Arch-laptop"

#
# Module to load at boot-up (in this order)
#   (prefix a module with a ! to disable it)
#
MODULES=(!usbserial !ide-scsi snd-es1968 yenta-socket pcmcia ohci_hcd ehci_hcd pcspkr parport_pc parport irtty_sir sir_dev irda crc_ccitt i2c_piix4 i2c_core uhci_hcd usbcore tsdev evdev rsrc_nonstatic pcmcia_core snd_ac97_codec snd_pcm_oss snd_mixer_oss snd_pcm snd_timer snd_page_alloc gameport snd_mpu401_uart snd_rawmidi snd_seq_device snd soundcore rtc)

#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
#   (prefix an interface in INTERFACES with a ! to disable it)
#
# Note: to use DHCP, set your interface to be "dhcp" (eth0="dhcp")
#
lo="lo 127.0.0.1"
eth0="dhcp"
INTERFACES=(lo eth0)

#
# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
#   (prefix a route in ROUTES with a ! to disable it)
#
gateway="default gw 192.168.0.1"
ROUTES=(!gateway)

#
# Daemons to start at boot-up (in this order)
#   (prefix a daemon with a ! to disable it)
#
DAEMONS=(dbus hal pcmcia syslog-ng crond network !netfs !hotplug)

# End of file

Any suggestions would be appreciated.


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

#2 2005-04-21 15:05:42

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: dhcp and pcmcia NIC startup (SOLVED)

MasonM wrote:

It works fine, but when I restart the box, or start up from a cold start, dhcp isn't assigning an IP, and during boot, network fails on start. After the box is up and running, I have to remove the card from the slot and reinsert it to get dhcp to assign an IP.

Never heared things like that. So I will try to guess.
· When you boot the machine the first time it is just fine?
· Do you really have to remove the card from the slot, isn't 'cardctl eject' enough?
· Does it work with static IP?
· Does your machine own another nic, so the race who will become eth0 could be won by an ethernet card? To seperate your wireless from ethernet nics you could try to have an alias entry in modules.conf like 'alias wlan0 kernelmodule' and change the nic section in rc.conf to something like

wlan0="dhcp"
INTERFACES=(lo wlan0)

, like most distributions do.
By the way, which kernel modules own the axnet drivers?I can't see any matching module in rc.conf's modules section, and you have hotplug disabled.

All my ideas are rough, my linux laptop is at home. I will have a look at it's configurations (allthough I don't use an axnet card, but an us robotics) and have a look on the details, if you can't come along. For sure, I might be completely wrong. It's just a couple of ideas.


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#3 2005-04-21 15:24:33

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

Re: dhcp and pcmcia NIC startup (SOLVED)

# When you boot the machine the first time it is just fine?

No it has this problem every time the machine is started.

# Do you really have to remove the card from the slot, isn't 'cardctl eject' enough?

Removing and reinserting the card is faster than typing out a command so that's what I do.

# Does it work with static IP?

Don't know, router is set up as DHCP and haven't tried changing it to static. As it's a mobile machine, I'd prefer it works using dhcp.

# Does your machine own another nic, so the race who will become eth0 could be won by an ethernet card?

No, I just have the one NIC at the moment. I have a wireless pcmcia NIC as well, but haven't installed/configured it yet as I don't use it much and would like to solve this ethernet problem first.

#By the way, which kernel modules own the axnet drivers?I can't see any matching module in rc.conf's modules section, and you have hotplug disabled.

It's owned by pcmcia, which loads the module itself when the card is detected. This is working perfectly and the driver modules loads no problem. As far as I can tell the problem seems to be with the network daemon itself, but I could be mistaken about this.

I disabled hotplug for the moment while I try to figure this out. At first I thought hotplug was the culprit but even with it disabled the problem remains. I just haven't bothered to re-enable hotplug as I already have all the modules loading through rc.conf anyway and it speeds up booting.

Hope the additional info may help figure this out. I'm stumped.


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

#4 2005-04-21 15:58:25

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp and pcmcia NIC startup (SOLVED)

ok, so it looks like pcmcia cold plugging isn't working.... can you try loading the axnet driver by hand (modprobe)?

Also, on a side note...
it should be safe to trim your modules array down to:

MODULES=(snd-es1968 yenta-socket pcmcia ohci-hcd ehci-hcd uhci-hcd snd-pcm-oss)

and you only need one of uhci_hcd/ohci_hcd (it depends on the hardware)... the rest of the stuff was dependant modules (i.e. modprobing snd-es1968 and snd-pcm-oss will add in the other 10 or so sound modules) and hotplug modules... the only one that *may* be useful is the paraport module if you use your parallel port.

Offline

#5 2005-04-21 16:24:51

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

Re: dhcp and pcmcia NIC startup (SOLVED)

Yeah, I plan to trim down the modules once I'm comfortable with getting this NIC problem figured out.

ok, so it looks like pcmcia cold plugging isn't working.... can you try loading the axnet driver by hand (modprobe)?

No, pcmcia loads the axnet module fine, that isn't the problem. It has something to do with dhcp, just haven't nailed down what is causing it yet.

While this problem is hardly a showstopper is it a PITA.


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

#6 2005-04-21 16:39:11

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp and pcmcia NIC startup (SOLVED)

MasonM wrote:

No, pcmcia loads the axnet module fine, that isn't the problem. It has something to do with dhcp, just haven't nailed down what is causing it yet.

Well, if it has nothing to do with modules/pcmcia, then why do you have to remove/reinsert the card to get it working?

Once you boot, try not touching the card and running "dhcpcd eth0" and see if that works...

If it's just a dhcp problem, it's probably not giving the router enough time - maybe try upping the dhcp timeout - edit /etc/conf.d/dhcpcd and change the number after "-t" in the DHCP_ARGS variable...

*shrug*

can you compare the lsmod before and after you do the boot-remove-reinsert process?

Offline

#7 2005-04-21 17:34:59

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: dhcp and pcmcia NIC startup (SOLVED)

Just change the rc.conf to static ip usage, to seperate one possible source of error from the other. You should know which ip ranges could be used, use one out of the dhcp pool.

It things go well then, the problem is your router, If not, the problem is on your machine.


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#8 2005-04-21 17:37:47

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

Re: dhcp and pcmcia NIC startup (SOLVED)

Well, if it has nothing to do with modules/pcmcia, then why do you have to remove/reinsert the card to get it working?

Once you boot, try not touching the card and running "dhcpcd eth0" and see if that works...

Just a quick and easy way to reinitialize dhcpcd. If I run "dhcpcd eth0" it assigns an IP quickly. Pretty much the same as removing and reinserting the card.


maybe try upping the dhcp timeout

OK, tried upping the timeout to 60 seconds. No better result. The router normally assigns an IP in about 10 seconds or so when everything is working properly.

can you compare the lsmod before and after you do the boot-remove-reinsert process?

Exactly the same.

I am thinking the problem may be in the shutdown process. I watched the messages during shutdown and when it tries to modprobe -r the axnet module it errors saying the axnet module is still in use. Perhaps this is preventing dhcp from releasing the lease and clearing associated files, causing an error on restart?

*Scratching head*


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

#9 2005-04-21 17:42:24

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp and pcmcia NIC startup (SOLVED)

hmmm well, ummm maybe try that all manually... try to do something like this:

boot
...
# dhcpcd eth0
# ifconfig eth0 down
# modprobe -r axnet
# modprobe axnet (?)
# dhcpcd eth0

I'm really at a loss here... did you try adding the axnet module to the module arrays?

Offline

#10 2005-04-21 18:07:02

Moo-Crumpus
Member
From: Hessen / Germany
Registered: 2003-12-01
Posts: 1,487

Re: dhcp and pcmcia NIC startup (SOLVED)

MasonM wrote:

Perhaps this is preventing dhcp from releasing the lease and clearing associated files, causing an error on restart?

*Scratching head*

In most cases leases last for several days, so machines in a large net will not be mixed up again and again. If you have not changed the lease times, there will be a lease time about a week or so.

My advice still is, don't use dhcp on the machine, set the nic up with a static ip. See if things work then. If they do, progress on dhcp, if not, check your machine. Ok, you can still mix all up and see no end. A structured procedure is better, as far as I am concerned.


Frumpus addict
[mu'.krum.pus], [frum.pus]

Offline

#11 2005-04-21 18:11:17

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp and pcmcia NIC startup (SOLVED)

Pink Chick wrote:

My advice still is, don't use dhcp on the machine, set the nic up with a static ip. See if things work then. If they do, progress on dhcp, if not, check your machine. Ok, you can still mix all up and see no end. A structured procedure is better, as far as I am concerned.

yeah, good idea... seeing as there's no where else to go from here... all you have to do is use the value in rc.conf for a static ip and make sure your IP is outside the dhcp range (to be safe).  Then try rebooting

Offline

#12 2005-04-21 19:24:33

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

Re: dhcp and pcmcia NIC startup (SOLVED)

Ok, I tried using a static IP for testing purposes. It isn't the router.

I also booted a LiveCD a few times and connection was no problem.

Adding axnet_cs to the modules array did stop the modprobe -r error message on shut down, but still having the same dhcp problem on start up.

I'm at a loss here now. Using  SimplyMepis it works perfectly, so I know it isn't a hardware issue, but rather a scripting or config error but so far no luck finding it.


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

#13 2005-04-21 19:43:11

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

Re: dhcp and pcmcia NIC startup (SOLVED)

OK, this time I removed network from the daemons in rc.conf and just booted up without starting it.

I ran /etc/rc.d/network start after booting up and exact same problem, network fails to start.

If I run dhcpcd eth0 then it assigns the IP.

Then run /etc/rc.d/network start and it starts fine.

??????????????


I know I must be missing something simple.


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

#14 2005-04-21 19:53:16

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp and pcmcia NIC startup (SOLVED)

hmmm... can you compare the order in which mepis does it compared to arch.... I don't know what it could be... but I know some people have had a similar issue with the network not starting on boot, but it starts right after.... I'd suggest posting a bug report to the bug tracker (top of the page) about this... I don't know if there is one yet...

Offline

#15 2005-04-21 20:03:18

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

Re: dhcp and pcmcia NIC startup (SOLVED)

Yeah, I thought about posting a bug report, and will do so once I have a good idea of where the problem really is, or give up trying to figure it out.

I did look at how Mepis is doing it, their startup scripting is different which makes comparison different. There is no rc.conf that I can find.

I watched the start up message sequence and it's pretty close to what I have with Arch now, but still something isn't quite right because the problem still exists.

I feel that it is in the network script itself, but I'm not spotting the problem when looking through it.

I do appreciate all the suggestions and assistance.


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

#16 2005-04-21 20:19:29

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp and pcmcia NIC startup (SOLVED)

I'll look into it too - try searching these forums, because I recall a similar problem...

Offline

#17 2005-04-21 21:09:42

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

Re: dhcp and pcmcia NIC startup (SOLVED)

Ok, I found the problem. It was in the /etc/rc.d/network script, and as I suspected it did have to do with the shutdown process.

In the network script, in the ifdown() section, it read:

if [ -f /etc/dhcpc/dhcpcd-${1}.pid ]; then
            /bin/kill `cat /etc/dhcpc/dhcpcd-${1}.pid`

which basically just deletes the .pid file without dhcpcd actually releasing anything. Bad way to do it.

I changed it to read:

if [ -f /etc/dhcpc/dhcpcd-${1}.pid ]; then
            /sbin/dhcpcd -k

which causes dhcpcd to release and then delete the .pid and .cache files.

Problem solved.


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

#18 2005-04-21 21:14:36

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp and pcmcia NIC startup (SOLVED)

wow, good job... make sure to post the fix in the bug tracker...

Offline

#19 2005-04-21 21:18:50

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

Re: dhcp and pcmcia NIC startup (SOLVED)

Thanks, and will do. (Only took me all day to find it. Good thing I'm not a programmer LOL )


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

#20 2005-04-21 21:27:14

phrakture
Arch Overlord
From: behind you
Registered: 2003-10-29
Posts: 7,879
Website

Re: dhcp and pcmcia NIC startup (SOLVED)

for the record, I've added the change here as well:

http://wiki2.archlinux.org/index.php/Wi … p%20Script

Offline

#21 2005-04-21 21:41:07

MasonM
Member
From: Plant City, FL
Registered: 2005-04-20
Posts: 19

Re: dhcp and pcmcia NIC startup (SOLVED)

Cool. Glad to know I could be of some small help. smile

Thanks for mentioning me in the script. Kinda cool.


Mason

Linux: because a PC is a terrible thing to waste.

Registered Linux User # 382617

Offline

Board footer

Powered by FluxBB