# IP was already taken by eth0

## To

I've this strange error... I'm trying to fix this, first I thout it was a baselayout problem, but the time has passed updates came and didn't fixed.

This error just happends when I try to set up an IP address manually, if I use DHCP I've no problem at all (so it ain't a kernel problem).

Here's my /etc/conf.d/net:

```
config_eth0=( "192.168.2.2 netmask 255.255.255.0 broadcast 192.168.2.255" )

routes_eth0=(

        "default via 192.168.2.1"

)

```

This worked fine for a long time.

So it must be something else, what?

Tó

----------

## SoylentGreen

well, there actually have been changes to /etc/conf.d/net a while back. dunno if this helps, but mine looks like this and works:

```

config_eth0=( "192.168.178.2 brd 192.168.178.255" )

gateway="eth0/192.168.178.1"

```

maybe that helps. of course you know that you have to adjust your local IP addresses accordingly  :Wink: 

----------

## To

Like I thought, it gives me the same error.

----------

## SoylentGreen

```

modules=( "ifconfig" )

```

iproute 2 and everything else disabled, except the 2 lines i posted above.

didnt change anything in the kernel since years here..

----------

## UberLord

Most dhcp clients don't check to see if the IP address they have been given already exists or not, which is why you don't see it.

Try arping 192.168.178.2 and see which MAC address is claiming it on your network

----------

## To

I did... and guess what it's my own MAC address... really strange... but this ain't a DHCP problem, I'm setting the IP adrees. When I use dhcp I don't have problems (but I can't use the same IP, cause it's out of the dhcp server range, and the configuration doesn't allow to change it either, cheats switchs hehe)

Tó

----------

## SoylentGreen

hmm, just btw.. another thing changed during the last weeks:

/etc/init.d/net.eth0 is a symlink to /etc/init.d/net.lo

thats all of the changes regarding networking i can think of sofar.

if you actually have both of them (net.eth0 *and* net.lo), i guess the ip is already taken by one of them? well, i dont know, but it sounds logically  :Wink: 

also, in your default runlevel, do *not* start net.eth0 *and* net.lo. one of them is sufficient.

----------

## UberLord

Well, we only flipped on the arpcheck by default in the last few baselayout releases ......

Could you post the output of the following please

```
/sbin/arping -c 2 -w 3 -D -f -I eth0 192.168.2.2

ifconfig eth0
```

Thanks

----------

## SoylentGreen

just did that here, dunno if it helps you because i do not have any problems, though:

```

hds ~ # /sbin/arping -q -c 2 -w 3 -D -f -I eth0 192.168.178.2

hds ~ # ifconfig eth0

eth0      Protokoll:Ethernet  Hardware Adresse 00:50:BF:50:01:28

          inet Adresse:192.168.178.2  Bcast:192.168.178.255  Maske:255.255.255.0

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          Kollisionen:0 Sendewarteschlangenlänge:1000

          RX bytes:2154003 (2.0 Mb)  TX bytes:344559 (336.4 Kb)

          Interrupt:10 Basisadresse:0xe000

```

```

sys-apps/baselayout-1.12.0_pre19-r2  USE="unicode -bootstrap -build -static"

```

----------

## UberLord

I meant for To to post his output   :Rolling Eyes: 

BTW, updated the arping command to actually display something - lol.

----------

## SoylentGreen

 *UberLord wrote:*   

> 
> 
> BTW, updated the arping command to actually display something - lol.

 

see? so my post was at least of a little help  :Wink: 

----------

## To

```
gandalf ~ # arping -c 2 -w 3 -D -f -I eth0 192.168.2.2

ARPING 192.168.2.2 from 0.0.0.0 eth0

Sent 2 probes (2 broadcast(s))

Received 0 response(s)

gandalf ~ # ifconfig eth0

eth0      Link encap:Ethernet  HWaddr 00:50:04:0D:50:72  

          inet addr:192.168.2.101  Bcast:192.168.2.255  Mask:255.255.255.0

          UP BROADCAST NOTRAILERS RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 txqueuelen:1000 

          RX bytes:38905 (37.9 Kb)  TX bytes:19125 (18.6 Kb)

          Interrupt:11 Base address:0x2000 

gandalf ~ # 
```

----------

## To

Btw:

```
gandalf ~ # ls -la /etc/init.d/net*

lrwxrwxrwx 1 root root     6 May  4 15:32 /etc/init.d/net.eth0 -> net.lo

-rwxr-xr-x 1 root root 29751 May  4 15:32 /etc/init.d/net.lo

-rwxr-xr-x 1 root root  3046 May  4 15:32 /etc/init.d/netmount

gandalf ~ # 
```

and I've this:

```
gandalf ~ # rc-update -s    

 * Invalid runlevel entry: /etc/runlevels/boot/.keep

 * Invalid runlevel entry: /etc/runlevels/default/.keep

 * Invalid runlevel entry: /etc/runlevels/nonetwork/.keep

 * Invalid runlevel entry: /etc/runlevels/single/.keep

            bootmisc | boot                          

             checkfs | boot                          

           checkroot | boot                          

               clock | boot                          

         consolefont | boot                          

            hostname | boot                          

             hotplug |      default                  

             keymaps | boot                          

               local |      default nonetwork        

          localmount | boot                          

             modules | boot                          

               mysql |      default                  

            net.eth0 | boot                          

              net.lo | boot                          

                 nfs |      default                  

             portmap |      default                  

           rmnologin | boot                          

               samba |      default                  

              serial | boot                          

                sshd |      default                  

           syslog-ng |      default                  

             urandom | boot                          

              vsftpd |      default                  

gandalf ~ # 
```

while trying to fix this I've removed netmount, what exactly is needed here?

 netmount and net.eth0/net.lo?

----------

## UberLord

 *To wrote:*   

> 
> 
> ```
> gandalf ~ # arping -c 2 -w 3 -D -f -I eth0 192.168.2.2
> 
> ...

 

That's wierd - you there's no arp response.

Care to post the full output of net.eth0 starting when RC_VERBOSE="yes" in /etc/conf.d/rc ?

----------

## To

Crap... had a prob with iproute2... using ifconfig everything worked just fine...

Thanx guys  :Wink: 

Tó

----------

## SoylentGreen

 *To wrote:*   

> Crap... had a prob with iproute2... using ifconfig everything worked just fine...
> 
> Thanx guys 
> 
> Tó

 

hmm, thats what i told you earlyer this day: (well, actually yesterday, hehe)

https://forums.gentoo.org/viewtopic-p-3305395.html#3305395

though, have one of those nice portugese wine on me.

cheers! and: put a [SOLVED] in your 1st post subject, thx!

----------

## UberLord

 *To wrote:*   

> Crap... had a prob with iproute2... using ifconfig everything worked just fine...

 

Um how? What exactly did you change / do?

----------

## SoylentGreen

 *UberLord wrote:*   

>  *To wrote:*   Crap... had a prob with iproute2... using ifconfig everything worked just fine... 
> 
> Um how? What exactly did you change / do?

 

the "new" /etc/conf.d/net defaults to iproute2, not ifconfig. i didnt now how to deal with this either, so i disabled iproute, and used ifconfig like it used to be. i guess this is the same problem he had.

----------

## UberLord

The usage of ifconfig/iproute2 has nothing todo with arping  :Smile: 

Hence, why I asked.

Also, if you have a problem with iproute2 then please file a bug so I can fix it   :Twisted Evil: 

----------

## SoylentGreen

 *UberLord wrote:*   

> 
> 
> Also, if you have a problem with iproute2 then please file a bug so I can fix it  

 

i dont think there is a problem with iproute2. i simply didnt know what it is, and the net didnt work out of the box. so i compared the old and new conf.d/net, switched to ifconfig like it was the case before, and everything worked again.

i guess i have to enable some things in the kernel to get it to work, dunno. i simply was too lazy that day reading docs or whatever.. so i left it with ifconfig and everything was fine  :Wink: 

----------

## UberLord

Do you want to help others? Do you want to help improve the Gentoo experience?

If so, then stop forcing ifconfig, try out networking and if it fails file a bug. Then you may revert back, except when testing my recommended fixes  :Smile: 

----------

## To

I've made changes on iproute2 for something that I needed. And that endup breaking the binary. I've re-emerge iproute2 but something went wrong. Now everything is fixed.

It was a while my last reboot, that why I didn't even remember that... soz.

Tó

----------

## SoylentGreen

whoa! you have to emerge iproute2? well, how could i know   :Embarassed: 

works here now as well   :Razz: 

@UberLord how are we supposed to know that ifconfig gets deprecated? ah, i see:

```

##############################################################################

# INTERFACE HANDLERS

#

# We provide two interface handlers presently: ifconfig and iproute2.

# You need one of these to do any kind of network configuration.

# For ifconfig support, emerge sys-apps/net-tools

# For iproute2 support, emerge sys-apps/iproute2

# If you don't specify an interface then we prefer iproute2 if it's installed

# To prefer ifconfig over iproute2

```

my bad   :Laughing: 

btw.. i think there is a typo:

```

 Prefer ifconfig over iproute2

modules=( "iproute2" )

```

shouldnt that read " Prefer iproute2 over ifconfig"? if so, fix that   :Very Happy: 

----------

## UberLord

All much ado about nothing then   :Evil or Very Mad: 

@SoylentGreen if you check the net.example that actually ships you'll find this already fixed, so someone didn't etc-update  :Razz: 

----------

## SoylentGreen

 *UberLord wrote:*   

> All much ado about nothing then  
> 
> @SoylentGreen if you check the net.example that actually ships you'll find this already fixed, so someone didn't etc-update 

 

damned, you are right   :Laughing: 

well, i never do etc-update, i always update my confs manually, and dont touch them as long as everything works to my personal satisfaction.

if you like to get a real shock, check this out:

```

 * IMPORTANT: 107 config files in /etc need updating.

 * IMPORTANT: 3 config files in /usr/kde/3.5/share/config need updating.

 * IMPORTANT: 72 config files in /usr/lib/X11/xkb need updating.

 * IMPORTANT: 1 config files in /usr/share/config need updating.

```

 :Laughing: 

OTOH: why

 *UberLord wrote:*   

> 
> 
> All much ado about nothing then 
> 
> 

 

 :Shocked: 

that doode had a problem and it got fixed. so really nothing to get evil about  :Wink: 

keep up your good work! and thx for looking into this thread. not many devs do so. your work is highly appreciated (seriously!)

----------

## To

 *UberLord wrote:*   

> All much ado about nothing then  
> 
> 

 

Problably some kind of check should be included on the init script so check if the commands are working properly. Just a thought.

Tó

----------

## UberLord

We rely on the command turning a non-zero status when it doesn't work .... Most commands do this, including iproute2 stuff

----------

