# net init script fails with renamed interfaces [fixed itself]

## c45207

I am using a udev rule to rename my network card. It is now called "lan". Therefore, I have created net.lan as a link to net.lo.

Was I correct in doing so?

However, on first bootup, net.lan (dhcpcd to be specific) complains that the interface "lan" does not exist. However, by the time I login, everything seems to be working correctly. Is this simply a timing issue, or did I do something wrong?

udev rule:

```

KERNEL="eth*", SYSFS{address}="proper MAC address", NAME="lan"

```

/etc/conf.d/net

```

config_lan=( "dhcp" )

dhcpcd_lan="-D"

```

Is more information needed?Last edited by c45207 on Sat Feb 18, 2006 4:35 pm; edited 1 time in total

----------

## Adrien

Before tryin' to start it at boot., check if your lan interface appears in the output of:

```
# ifconfig -a
```

But I'm not sure it is possible to rename an interface like this... don't know

----------

## UberLord

Ensure that the MAC address is in lower case - upper case does not work. Also, you may need KERNEL== instead of KERNEL= with newer udev versions.

----------

## Adrien

 *UberLord wrote:*   

> When baselayout tells you to update config files or things break WE REALLY DO MEAN IT

 

 :Laughing: 

----------

## c45207

 *Adrien wrote:*   

> Before tryin' to start it at boot., check if your lan interface appears in the output of:
> 
> ```
> # ifconfig -a
> ```
> ...

 

It does, as does the other interface I am renaming the same way (but not starting at boot).

 *UberLord wrote:*   

> Ensure that the MAC address is in lower case - upper case does not work. Also, you may need KERNEL== instead of KERNEL= with newer udev versions.

 

I had the MAC address in lowercase before. I also tried with KERNEL==. I still get the same thing.

Since I CAN configure it using "lan" (and not eth0, which doesn't exist anymore"), the rename rule is working. Is it not taking effect before the script is run? Is there a bug in the script?

 *Adrian wrote:*   

>  *UberLord wrote:*   When baselayout tells you to update config files or things break WE REALLY DO MEAN IT 

 

I don't need to remerge baselayout, do I? I considered doing that, seeing as I may have broken something...

 :Sad: 

----------

## UberLord

Do you have net.eth0 and/or net.lan in the default runlevel?

----------

## c45207

 *UberLord wrote:*   

> Do you have net.eth0 and/or net.lan in the default runlevel?

 

net.eth0, no (it doesn't even exist).

net.lan, yes.

When net.lan is run during boot-up, it doesn't work. If it is run after boot-up, it does work.

----------

## UberLord

 *c45207 wrote:*   

> When net.lan is run during boot-up, it doesn't work. If it is run after boot-up, it does work.

 

Could you be a little tinsy bit more precise, like say posting any error messages? If there are no error messages how do you know it didn't work? (ie, the output from ifconfig isn't what you expect for example)

----------

## c45207

Could you be a little tinsy bit more precise, like say posting any error messages? If there are no error messages how do you know it didn't work? (ie, the output from ifconfig isn't what you expect for example)[/quote]

From /var/log/messages

```

Aug 30 17:48:47 chris-tablet rc-scripts: lan does not exist

Aug 30 17:48:47 chris-tablet cron[5325]: (CRON) STARTUP (V5.0)

Aug 30 17:48:48 chris-tablet rc-scripts: ERROR:  Problem starting needed services.

Aug 30 17:48:48 chris-tablet rc-scripts:         "netmount" was not started.

Aug 30 17:48:51 chris-tablet tg3: lan: Link is up at 10 Mbps, half duplex.

Aug 30 17:48:51 chris-tablet tg3: lan: Flow control is off for TX and off for RX.

```

----------

## UberLord

I would file a bug on bugs.gentoo.org

----------

## c45207

 *UberLord wrote:*   

> I would file a bug on bugs.gentoo.org

 

Will do.

By the way, I was able to sort of get it to work by putting a "sleep 3" at the beginning of net.lo's start().

----------

## c45207

Bug Report:

https://bugs.gentoo.org/show_bug.cgi?id=104535

----------

## jkroon

Hmm, odd problem.  I'm guessing this is the sequence of events happening without the sleep 3:

1.  net.lan script loads the tg3 module.

2.  net.lan script tries to configure tg3 module.

3.  tg3 module finishes initialization and detects "link beat".

4.  'lan' ethernet device becomes available.

With the sleep 3 event no 2 moves down to 4 and thus works.

Try adding the tg3 module to /etc/modules.autoload.d/kernel-2.6 and see whether that doesn't also solve the problem (will get loaded _long_ before net.lan gets executed).

----------

## c45207

Thanks to all. It seems a recent update to the kernel, udev, or baselayout seems to have fixed the problem.

I'm not going to close the bug report because the issue at hand seems like a deeper timing issue that deserves more investigation.

----------

