# Unable to set IP address on eth1[SOLVED]

## madchaz

Good day all

I have been trying to solve this one for a while without luck. I am hoping someone can help me. 

I have been working on a new server. It as 2 nics, etho and eth1. Both work and are detected fine by the kernel. 

For the purpoce of my setup, I need both NIC to have a static IP address. 

eth0 is to be set at 192.168.20.1/24 and is the default gateway (to 192.168.20.2)

eth1 is to be set at 10.0.0.1/24 

eth0 comes up fine. 

eth1, however doesn't. Here is what I get. 

```

kami ~ # /etc/init.d/net.eth1 restart

 * Starting eth1

SIOCSIFFLAGS: Cannot assign requested address

SIOCSIFFLAGS: Cannot assign requested address

SIOCSIFFLAGS: Cannot assign requested address

SIOCSIFFLAGS: Cannot assign requested address

 *   Bringing up eth1

 *     10.0.0.1/24

SIOCSIFFLAGS: Cannot assign requested address

SIOCSIFFLAGS: Cannot assign requested address                             [ !! ]

kami ~ #

```

I know for a fact that the IP address is available (it is alone in it's subnet), so I figured this ment it could not load the proper module. However, lspci shows it should be the same for both.

```

kami ~ # lspci | grep thernet

02:0b.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)

02:0c.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RT8139 (B/C) Cardbus Fast Ethernet Adapter (rev 10)

kami ~ #

```

A quick look in /var/log shows no updated log after restarting eth1. 

I figured it might be that the cable was unpluged, so I pluged it into a empty hub so it would have link. Exactly the same result as above. 

nothing in /var/log is updated when I restart the interface. Anyone as an idea?

----------

## vaguy02

That's strange there is no log updates. Hum...can you post your /etc/conf.d/net file?

----------

## madchaz

```
kami log # cat /etc/conf.d/net

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

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

# please review /etc/conf.d/net.example and save your configuration

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

config_eth0=( "192.168.100.8/24" )

routes_eth0=( "default via 192.168.100.2" )

config_eth1=( "10.0.0.1/24" )

kami log #

```

I also added some information in the first post before you replied.

----------

## vaguy02

A quick google search revealed the following, it's not exactly your error messages, but it seems related so I thought I might bring it up.

 *Quote:*   

> 
> 
> Q: Ethernet networking is not working. I get the error message:
> 
> "SIOCSIFFLAGS: Try again"
> ...

 

----------

## madchaz

I'd be rather surprised if it was IRQ, but maybe. 

Any idea how you get to find out the IRQ the cards are using? I must admit, never had to do that in linux before.

----------

## d2_racing

Am not an expert on network, but since you have a mask of 24 bits, then

```

eth0 is to be set at 192.168.20.1/24 and is the default gateway (to 192.168.20.2)

eth1 is to be set at 10.0.0.1/24 

```

Then eth1 must be 192.168.20.3 at least since 1 is use(eth0) and 2 actually(gateway).

----------

## cyrillic

You can see IRQ information for your NICs like this.

```
# cat /proc/interrupts

# ifconfig -a

# dmesg

# lspci -v 
```

Last edited by cyrillic on Fri Jan 02, 2009 1:59 am; edited 1 time in total

----------

## platojones

 *madchaz wrote:*   

> I'd be rather surprised if it was IRQ, but maybe. 
> 
> Any idea how you get to find out the IRQ the cards are using? I must admit, never had to do that in linux before.

 

try 'cat /proc/interrupts'

----------

## Hu

Is there anything interesting in the kernel log after those messages are displayed?

 *d2_racing wrote:*   

> Am not an expert on network, but since you have a mask of 24 bits, then
> 
> ```
> 
> eth0 is to be set at 192.168.20.1/24 and is the default gateway (to 192.168.20.2)
> ...

 

His choice of addresses is fine, although it is traditional to have a default gateway at .1.

----------

## madchaz

 *cyrillic wrote:*   

> You can see IRQ information for your NICs like this.
> 
> ```
> # cat /proc/interrupts
> 
> ...

 

well, it's not IRQ I guess. One is on IRQ 5 and the other on IRQ 9. The one that does not work is on IRQ9 and nothing else is using it, unlike IRQ 5 (and that card works)

----------

## madchaz

 *Hu wrote:*   

> Is there anything interesting in the kernel log after those messages are displayed?
> 
>  *d2_racing wrote:*   Am not an expert on network, but since you have a mask of 24 bits, then
> 
> ```
> ...

 

traditional and usually a lot less confusing. However, due to technical limitations, I have to use something else then 1 right now, so I use 2. 

Edit:Only saw the question above after I pusted. Nothing of interest in the dmesg. Or did you mean somewhere else?

to d2_racing: My IP choice is as I want it. One interface (eth0) is supposed to be on the 192.168.20.x network, while eth1 needs to be on the 10.0.0.x network. I do not expect the machine to be able to get OUT of the 10.0.0.x network, that is why it as no gateway. It can talk to what is on that network, but nothing beyond it (like the internet). It will get internet from 192.168.20.x

----------

## cyrillic

IRQ9 is normally reserved for ACPI, and you should not have a network card trying to use it.

Try changing some BIOS settings, or if that is not possible, plug the network card into a different PCI slot to change its IRQ assignment.

----------

## Hu

 *madchaz wrote:*   

> traditional and usually a lot less confusing. However, due to technical limitations, I have to use something else then 1 right now, so I use 2. 
> 
> Edit:Only saw the question above after I pusted. Nothing of interest in the dmesg. Or did you mean somewhere else?

 

No, that is what I meant.  I suppose someone could search the kernel source for the places where that error code is returned, but that could involve sifting through quite a bit of other noise if the search is not well targeted.  What kernel version are you using?  Do you know which CONFIG_ option supplies the driver for your card?

----------

## jcat

Are you able to assign any addresses at all (just for testing)?

Have you tried removing eth1 from /etc/conf.d/net and using ifconfig to manually assign settings (again, just for testing)?

Cheers,

jcat

----------

## krinn

i agree with ACPI trouble, old irq system was using only 16 irq and irq9 was used by vga card, today you can have more (i don't know how many but my comp assign an irq23)

```
[    5.380913] ehci_hcd 0000:00:1d.7: irq 23, io mem 0xf9fff800

```

you can just see your irq in ifconfig, last line should give it, and as you see mine is working on an irq18

so imo, as someone said before, check your acpi state as acpi is in charge for handling irq > 16

```
eth0      Lien encap:Ethernet  HWaddr 00:1d:60:dd:98:61  

          inet adr:192.168.0.4  Bcast:192.168.0.255  Masque:255.255.255.0

          adr inet6: fe80::21d:60ff:fedd:9861/64 Scope:Lien

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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

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

          collisions:0 lg file transmission:1000 

          RX bytes:1976553649 (1.8 GiB)  TX bytes:790122484 (753.5 MiB)

          Interruption:18 

```

----------

## madchaz

Guess I'll start by trying to move it. Hopefully, a simple solution. 

I'll keep you updated. 

Hu: Will look to provide the kernel version. I don't think I want to read the kernel source. I do know it as been doing this for at least 3 revisions, as I don't work often on that box. 

jcat: I tried different addresses, none work. DHCP works, only if eth0 is unplugged. (even pluged in a empty hub makes it fail)

I will try to move the card in the next few days to see how that changes things. 

All: Sorry for the long reply time. Health gives you only so much time sometimes.

----------

## jasenux

hello,

honestly, i havent seen this error/problem before.... i would try boot the system using the gentoo bootable cd, and then try to configure the card from there.  if still not work, i will try remove the working card, eth0 from the system, again will reboot using the gentoo cd and see how it goes from there.

good luck.

----------

## madchaz

Well, turns out it really was an irq problem

Couldn't manually asign one, but changing PCI slot got eth1 to use another irq and it now works fine. Thanks all for your help.

----------

## vaguy02

You're welcome  :Smile: 

----------

