# connection to network only after net.eth0 restart

## Kolrotada

hi

i installed a fresh gentoo (and migrated to openrc)

after boot i have no connection to the network (Network is unreachable) but after '/etc/init.d/net.eth0 restart' everything works fine

here my output of route after boot, before eth0 restart

```
Kernel IP Routentabelle

Ziel            Router          Genmask         Flags Metric Ref    Use Iface

192.168.178.0   *               255.255.255.0   U     2      0        0 eth0

loopback        -               255.0.0.0       !     0      -        0 -

loopback        localhost       255.0.0.0       UG    0      0        0 lo
```

after eth0 restart

```
Kernel IP Routentabelle

Ziel            Router          Genmask         Flags Metric Ref    Use Iface

192.168.178.0   *               255.255.255.0   U     2      0        0 eth0

loopback        -               255.0.0.0       !     0      -        0 -

loopback        localhost       255.0.0.0       UG    0      0        0 lo

default         fritz.box       0.0.0.0         UG    2      0        0 eth0
```

my /etc/conf.d/net

```
config_eth0="dhcp"
```

while booting i got a message which i think could be useful:

```
* Adding static routes...

SIOCADDRT: Kein passender Prozess gefunden
```

Sorry for german, it means something like "no relevant process found"[/quote]

----------

## zhushazang

I have this problem too. But i'm using static ip configuration:

something like that

modules="iproute2"

dns_domain_lo="mydomain"

config_eth2="xxx.xxx.xxx.xxx netmask 255.255.255.192 brd xxx.xxx.xxx.xxx"

routes_eth2="default via xxx.xxx.xxx.xxx"

dns_servers_eth2="xxx.xxx.xxx.xxx xxx.xxx.xxx.xxx"

Changing the modules option to ifconfig, the problem is the same.

att

----------

## causality

Just to rule it out, do you have net.eth0 configured to run when the system boots?  If so, it should be visible when you run "rc-update show":

```
localhost ~ # rc-update show

               acpid | boot

           alsasound | boot

            bootmisc | boot

             cbqinit |      default

             checkfs | boot

           checkroot | boot

               clock | boot

         consolefont | boot

          consolekit |      default

               cupsd |      default

                dbus |      default

             dovecot |      default

           fetchmail |      default

                 gpm |      default

                hald |      default

            hostname | boot

             keymaps | boot

         kmyfirewall |      default

               local |      default nonetwork

          localmount | boot

             maradns |      default

             modules | boot

            net.eth0 |      default

              net.lo | boot

            netmount |      default

                ntpd |      default

             postfix |      default

           rmnologin | boot

               samba |      default

               spamd |      default

                sshd |      default

             urandom | boot

          vixie-cron |      default

localhost ~ #

```

If it does not show in that list, that's the cause of the issue.  In that case, you can add it as a startup service:

```
localhost ~ # rc-update add net.eth0 default
```

Last edited by causality on Sat Dec 12, 2009 9:06 pm; edited 1 time in total

----------

## d2_racing

Yeah, can you post your actual rc-update show

----------

## Kolrotada

Of course net.eth0 will be started while booting. and it is starting, without showing any errors, except that network is not reachable after that.

But here my rc-update show

```
Gentooner andi # rc-update show

                  gpm |                default

                 swap |           boot

          consolefont |           boot

                local | nonetwork      default

           consolekit |                default

               net.lo |           boot

       udev-postmount |                default

            syslog-ng |                default

                  xdm |                default

                 hald |                default

             hostname |           boot

            killprocs |                                       shutdown

              modules |           boot

             mount-ro |                                       shutdown

         termencoding |           boot

              keymaps |           boot

           localmount |           boot

              hwclock |           boot

                 udev |                               sysinit

                 fsck |           boot

              urandom |           boot

            savecache |                                       shutdown

                 mtab |           boot

                dmesg |                               sysinit

                devfs |                               sysinit

               sysctl |           boot

             net.eth0 |                default

                 root |           boot

             netmount |                default

              network |           boot

             bootmisc |           boot

               procfs |           boot
```

[/quote]

----------

## BigAl

I have exactly the same problem. I thought it was a one-off error on my new amd64 install, with ACCEPT_KEYWORDS="~amd64" in my make.conf. But I recently installed x86 gentoo inside a virtualbox on windows (different pc), and exactly the same problem.

/etc/init/net.eth0 is running during bootup, without any error - but afterwards there is no internet at all until it is restarted.

Can anyone offer some help? Guess I'll try to have gnome restart the script when it loads up.... but hardly ideal!

----------

## BigAl

Well, my solution to the problem is hardly a beautiful one... I simply did:

```
rc-update add dhcpcd default
```

Now on bootup, my network card is set up exactly as before (automatically by hotplug?) - but at the very end of the bootup process, /etc/init.d/dhcpcd is run, which prints something like:

```
dhcpcd: net.eth0: NAK
```

Nothing else..... but voila, internet works. Oh, and like the original poster, I had and still have this in my bootup (except in english): 

```
* Adding static routes...

SIOCADDRT: Kein passender Prozess gefunden
```

All I remember about 'SIOCADDRT' is it giving me endless nightmares back in my early gentoo kernel 2.4ish days - so I'm not bothered about a proper fix, it works now all I care!

----------

## zhushazang

I think that solved the problem.

removing /etc/init.d/network from boot init level

and put net.ethX in default init level

restarting...

working again.

that is all

----------

## Kolrotada

removing network from runlevel boot did it, thank you!

----------

