You are not logged in.

#1 2011-03-12 18:38:32

oliparcol
Member
From: Paris
Registered: 2010-02-26
Posts: 38

"SIOCSIFNETMASK: Cannot assign requested address" error

Hi,

Sometimes, when I try to force a static address to my ethernet card, I've got a strange error (SIOCSIFNETMASK: Cannot assign requested address) but, even with this error, my address is working well... For example:

$sudo ifconfig eth0 10.0.0.1/24
SIOCSIFNETMASK: Cannot assign requested address
$ ping 10.0.0.1
PING 10.0.0.1 (10.0.0.1) 56(84) bytes of data.
64 bytes from 10.0.0.1: icmp_req=1 ttl=64 time=0.024 ms
64 bytes from 10.0.0.1: icmp_req=2 ttl=64 time=0.040 ms
64 bytes from 10.0.0.1: icmp_req=3 ttl=64 time=0.045 ms
...

Someone has an idea about this strange error ?

Thanks !

EDIT: there was the same bug in ubuntu (https://bugs.launchpad.net/ubuntu/+bug/159460)

Last edited by oliparcol (2011-03-12 19:53:54)

Offline

#2 2011-03-12 23:38:04

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: "SIOCSIFNETMASK: Cannot assign requested address" error

You are providing an incorrect subnet mask.

/24 really means 255.255.255.0, which is the mask for a class C address (eg. 192.168.0.x)

Since you are using a class A address (10.0.0.x) you really want a subnet mask of 255.0.0.0 (which is /8).

Offline

#3 2011-03-13 00:25:08

pyther
Member
Registered: 2008-01-21
Posts: 1,395
Website

Re: "SIOCSIFNETMASK: Cannot assign requested address" error

awkwood wrote:

You are providing an incorrect subnet mask.

/24 really means 255.255.255.0, which is the mask for a class C address (eg. 192.168.0.x)

Since you are using a class A address (10.0.0.x) you really want a subnet mask of 255.0.0.0 (which is /8).

That isn't true. VLSM and CIDR?
We have 10.25.0.0/16 assigned to us at work, from our isp (isp does nat for us). I use a 10.20.1.0/24 at home.

@OP I'm not sure of your problems, That should work, Does dmesg show anything?


Website - Blog - arch-home
Arch User since March 2005

Offline

#4 2011-03-13 15:46:23

awkwood
Member
From: .au <=> .ca
Registered: 2009-04-23
Posts: 91

Re: "SIOCSIFNETMASK: Cannot assign requested address" error

My bad, to explain further:

/8 is the default mask for the 10.0.0.x private network which provides the full range of addresses.

Using /24 will only provide 10.0.0.1 to 10.0.0.254.  Your static IPs must all be within this range for the mask to be valid.

Offline

#5 2011-03-13 16:00:21

oliparcol
Member
From: Paris
Registered: 2010-02-26
Posts: 38

Re: "SIOCSIFNETMASK: Cannot assign requested address" error

it's not true, the /24 will constraint the lan to this type of addresses: 10.0.0.x but and address of this type: 10.1.2.x will work too...

Anyway, it's not the problem because the classfull ip system is not longer used (http://en.wikipedia.org/wiki/Classful_n … of_classes) and I'm getting this error with these type of IP too:

$ sudo ifconfig eth0 192.168.0.1/24
SIOCSIFNETMASK: Cannot assign requested address

Last edited by oliparcol (2011-03-13 16:01:52)

Offline

#6 2011-03-20 18:35:07

oliparcol
Member
From: Paris
Registered: 2010-02-26
Posts: 38

Re: "SIOCSIFNETMASK: Cannot assign requested address" error

nobody has the same problem ? I've got this on my two computers which are running arch...

Offline

#7 2011-08-02 17:56:20

felix125
Member
Registered: 2010-11-03
Posts: 1

Re: "SIOCSIFNETMASK: Cannot assign requested address" error

I have the same problem, and i don't know what it happened.
But when i change my cmd to ifconfig eth0:0 192.168.0.101 netmask 255.255.255.0 up,
It works!

Last edited by felix125 (2011-08-02 17:58:20)

Offline

#8 2011-08-03 17:49:16

oliparcol
Member
From: Paris
Registered: 2010-02-26
Posts: 38

Re: "SIOCSIFNETMASK: Cannot assign requested address" error

I think the best solution is to use iproute2

# ip addr add 192.168.1.1 dev eth0

No more warning...

Offline

Board footer

Powered by FluxBB