# eth0 not coming up correctly on startup

## taylorjonl

I am having an issue with getting my eth0 interface to come up on startup.  When starting, the system starts entering run level 3 and the first thing it does is try to bring up eth0 but this fails when DHCP tries to renew or acquire an IP.  If I let it fully boot, log in and run "/etc/init.d/net.eth0 restart" it brings up the interface correctly.

Here is my /etc/conf.d/net file:

```
# This blank configuration will automatically use DHCP for any net.*

# scripts in /etc/init.d.  To create a more complete configuration,

# please review /usr/share/doc/openrc*/net.example* and save your configuration

# in /etc/conf.d/net (this file :]!).

config_eth0="dhcp"

```

Here is the results of "rc-status" before I manually bring up eth0:

```
Runlevel: default

 net.eth0                                                                              [  stopped  ]

 syslog-ng                                                                             [  started  ]

 sshd                                                                                  [  stopped  ]

 udev-postmount                                                                        [  started  ]

 netmount                                                                              [  stopped  ]

 vixie-cron                                                                            [  started  ]

 local                                                                                 [  started  ]

Dynamic Runlevel: hotplugged

Dynamic Runlevel: needed

 sysfs                                                                                 [  started  ]

Dynamic Runlevel: manual

```

Any help is appreciated.

----------

## miroR

How about:

```
# ifconfig
```

and maybe 

```
# cat /etc/udev/rules.d/70-persistent-net.rules
```

----------

## taylorjonl

Sorry for the delay, wasn't able to check back until now, was repartitioning the system and have been fighting Grub for a few days.

Here is the result of an ifconfig immediately after bootup:

```
eth0      Link encap:Ethernet  HWaddr 00:15:17:0d:57:c6

          inet6 addr: fe80::215:17ff:fe0d:57c6/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:3 errors:0 dropped:0 overruns:0 frame:0

          TX packets:11 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000

          RX bytes:538 (538.0 B)  TX bytes:2374 (2.3 KiB)

          Interrupt:26 Memory:fbc80000-fbca0000

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:0 errors:0 dropped:0 overruns:0 frame:0

          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:0

          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

```

and here is the results of /etc/udev/rules.d/70-persistent-net.rules:

```
# This file was automatically generated by the /lib64/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

#

# You can modify it, as long as you keep each rule on a single

# line, and change only the value of the NAME= key.

# PCI device 0x8086:0x105e (e1000e)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:0d:57:c6", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

# PCI device 0x8086:0x105e (e1000e)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:12:b1:c4", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"

# PCI device 0x8086:0x10c9 (igb)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:c5:97:5b", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth7"

# PCI device 0x8086:0x105e (e1000e)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:0d:57:c7", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x8086:0x10d3 (e1000e)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:c5:93:a0", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth5"

# PCI device 0x8086:0x10c9 (igb)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:c5:97:5a", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth6"

# PCI device 0x8086:0x10d3 (e1000e)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:e0:81:c5:93:a1", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth4"

# PCI device 0x8086:0x105e (e1000e)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:15:17:12:b1:c5", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth3"

```

Hoping you or someone can help, this is the last issue I need to resolve before I have a working Gentoo install.

----------

## taylorjonl

I have a little more information, I enabled logging for RC and here is the default runlevel related parts:

```
rc default logging started at Fri Jan  6 20:41:34 2012

 * Bringing up interface eth0

 *   No configuration specified; defaulting to DHCP

 *   dhcp ...

 *     Running dhcpcd ...

dhcpcd[2361]: version 5.2.12 starting

dhcpcd[2361]: eth0: waiting for carrier

dhcpcd[2361]: eth0: carrier acquired

dhcpcd[2361]: eth0: rebinding lease of 192.168.1.105

dhcpcd[2361]: eth0: broadcasting for a lease

dhcpcd[2361]: timed out

dhcpcd[2361]: allowing 8 seconds for IPv4LL timeout

dhcpcd[2361]: timed out

 [ !! ]

 [ !! ]

 * ERROR: net.eth0 failed to start

 * ERROR: cannot start netmount as net.eth0 would not start

 * Starting syslog-ng ...

 [ ok ]

 * ERROR: cannot start sshd as net.eth0 would not start

 * Doing udev cleanups

 * Starting vixie-cron ...

 [ ok ]

 * Starting local

 [ ok ]

rc default logging stopped at Fri Jan  6 20:42:12 2012

```

----------

## taylorjonl

I was in IRC and iamben along with others were very helpful.  The problem seems to be that dhcpcd times out on the first request but the following requests succeed.  The solution was to add this line:

```
dhcpcd_eth0="-t 90"
```

to my /etc/conf.d/net file.

----------

## miroR

 *taylorjonl wrote:*   

> I was in IRC and iamben along with others were very helpful.  The problem seems to be that dhcpcd times out on the first request but the following requests succeed.  The solution was to add this line:
> 
> ```
> dhcpcd_eth0="-t 90"
> ```
> ...

 

Well, glad to know it's solved!

----------

