# [SOLVED] LAN interface staying stopped

## pneula

Dear Gentooers,

My LAN network (eth0) stopped starting a week ago and I haven't found the reason this far, so decided to ask you all. This is the error I keep getting when trying to start using /etc/init.d/net.eth0:

```
Error: either "local" is duplicate, or "netmask" is a garbage.
```

ifconfig output for the interface:

```
 eth0:

Link encap:Ethernet  HWaddr 00:50:fc:2f:07:b3  

UP BROADCAST MULTICAST  MTU:1500  Metric:1

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

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

collisions:0 txqueuelen:1000 

RX bytes:54378 (53.1 KiB)  TX bytes:0 (0.0 B)

Interrupt:16 Base address:0xd000 

```

Google didn't help and I'm getting annoyed because this might be something simple if one just knows what! iptables maybe? Please advice a keen Gentoo user to get his LAN up again!Last edited by pneula on Thu Jan 22, 2009 9:14 pm; edited 1 time in total

----------

## SeaTiger

Please post /etc/conf.d/net.

----------

## d2_racing

Hi, can you post your lspci ?

----------

## pneula

Hi and thank you for your replies!

My /etc/conf.d/net hasn't changed at all but here it is. My WAN interface is ppp0.

```
config_eth0=( "192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0" )

config_ppp0=("ppp")

link_ppp0=( "/dev/ttyUSB0" )

pppd_ppp0=(

        "460800"

        "crtscts"

        "modem"

        "noauth"

        "usepeerdns"

        "defaultroute"

        "noipdefault"

        "debug"

        "noccp"

        "nobsdcomp"

        "novj"

        "user ''"

        "password ''"

        "connect '/usr/sbin/chat -f /etc/ppp/chat-E220-pin || /usr/sbin/chat -f 

/etc/ppp/chat-E220-nopin'"

)
```

I have tried both NICs that I have free for LAN these days, as lspci shows:

```

# lspci | grep Eth

00:08.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

00:12.0 Ethernet controller: VIA Technologies, Inc. VT6102 [Rhine-II] (rev 78)

```

This strange interface problem just simply appeared and I have no idea why! Do you get any ideas based on these infos?

----------

## SeaTiger

Please post /etc/udev/rules.d/70-persistent-net.rules also.

----------

## pneula

All right, here you go, /etc/udev/rules.d/70-persistent-net.rules:

```

# PCI device 0x10ec:0x8139 (8139too)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:50:fc:2f:07:b

3", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

# PCI device 0x1106:0x3065 (via-rhine)

SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:19:db:aa:9f:a

0", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

```

I must say I don't know this file, something wrong with it?

----------

## SeaTiger

Try delete that file and reboot the machine.

----------

## pneula

Yeah, tried that, did not help. =(

----------

## lxg

What happens if you up the device manually?

```

ifconfig eth0 up

ifconfig eth0 192.168.0.1 broadcast 192.168.0.255 netmask 255.255.255.0

```

----------

## pneula

These commands don't give any errors! Thanks lxg, that's already great here!

Now, ifconfig shows same still:

```

eth0      Link encap:Ethernet  HWaddr 00:19:db:aa:9f:a0  

          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0

          UP BROADCAST MULTICAST  MTU:1500  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:1000 

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

          Interrupt:23 Base address:0xe000 

```

I'm sorry to be so novice, but can I get it running manually? It seems that initscript can get the interface up to this point, and then something hazardous happens.

----------

## lxg

You're welcome, but I forgot to ask: Can you ping something with these settings (by IP and/or domain name)? Elsewise ("network unreachable") it's worthless. If you can ping and access the net otherwise, it's great.

According to what I found in some Google results for your error message, there seems to be an error with your routing. It appears that you have more than one route set for the device.

 *Quote:*   

> Duplicate Default Gateways
> 
>  If the default gateway is already assigned from DHCP, the IP command arguments format can cause one of two errors during start-up, or when bringing up an interface from the down state using the ifup command: "RTNETLINK answers: File exists" or 'Error: either "to" is a duplicate, or "X.X.X.X" is a garbage.', where X.X.X.X is the gateway, or a different IP address. These errors can also occur if you have another route to another network using the default gateway. Both of these errors are safe to ignore.

 

http://www.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/5.2/html/Deployment_Guide/s1-networkscripts-static-routes.html

What is the output of your route command? Is it possible that, due to the fact that you have two ethernet devices, some settings got confused?

edit: Does it help to set a default gateway for your net.eth0 in the net configuration (see /etc/conf.d/net.example)?

----------

## pneula

Thanks, that is an interesting reference!

Answer first: I have no problems with my WAN interface ppp0, LAN only.

However, setting a default route didn't help. I played a little again and found that the netmask really is the problem somehow: when I removed the netmask declaration from the /etc/init.d/net, I did get the interface both up and running. However, I get nothing into the routing table and cannot ping into the LAN or receive an IP address from it using DHCP. I attach route command and hope you figure something out of it! (I changed the NIC just in case...now the LAN is in eth1)

```

# route

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

10.64.64.64     *               255.255.255.255 UH    0      0        0 ppp0

loopback        localhost       255.0.0.0       UG    0      0        0 lo

default         10.64.64.64     0.0.0.0         UG    4004   0        0 ppp0

```

Additionally still, adding route to LAN by this command does not solve the problem:

```

# route add -net 192.168.0.0 netmask 255.255.255.0 dev eth1

```

----------

## pneula

Oh my, this is weird.

I tried once again to bring eth1 up manually (with netmask) and I did succeed! I can ping and DHCP dealing works fine. May changing the NIC have had an impact?

Initscript still does not work!

----------

## lxg

Hm, I'm also a bit clueless ...

I understand that your ppp0 works fine, but is it possible that it messes up the routing? What happens if you shut down ppp0 and delete all routes, then set up your ethX ones? Or comment out the ppp0 config, remove net.ppp0 from all runlevels and reboot? Just to be sure that nothing in the ppp0 config (including the chat stuff) is interfering.

----------

## pneula

Yeah, I got it working!

I tried your idea of getting rid of ppp0 but that didn't help. Inspired by my Gentoo install at work today I then changed the /etc/conf.d/net setting for eth1by hazard and there, the initscript begun working again. I can't explain this but everything seems to be just like before. Can you explain? See my configuration of eth1 in /etc/conf.d/net below:

```

config_eth1=( "192.168.0.1 netmask 255.255.255.0 brd 192.168.0.255" )

```

----------

