iproute2 query

3 messages, 2 authors, 2016-02-23 · open the first message on its own page

iproute2 query

From: Marcus Furlong <hidden>
Date: 2016-02-19 09:12:24

Hi,

Just wondering if the following command should work:

# ip route add 192.168.27.27/24 dev eth0 scope link src 192.168.27.27
RTNETLINK answers: Invalid argument

However, this command works:

# ip route add 192.168.27.0/24 dev eth0 scope link src 192.168.27.27

192.168.27.0/24 and 192.168.27.27/24 describe the same subnet?

Regards,
Marcus.

-- 
Marcus Furlong

Re: iproute2 query

From: Stephen Hemminger <stephen@networkplumber.org>
Date: 2016-02-21 20:05:16

On Fri, 19 Feb 2016 20:12:04 +1100
Marcus Furlong [off-list ref] wrote:
Hi,

Just wondering if the following command should work:

# ip route add 192.168.27.27/24 dev eth0 scope link src 192.168.27.27
RTNETLINK answers: Invalid argument

However, this command works:

# ip route add 192.168.27.0/24 dev eth0 scope link src 192.168.27.27

192.168.27.0/24 and 192.168.27.27/24 describe the same subnet?

Regards,
Marcus.
It is the kernel complaining, not ip command.
The kernel will not accept 192.168.27.27/24 as route since it is a full
network address, not an network prefix.

Re: iproute2 query

From: Marcus Furlong <hidden>
Date: 2016-02-23 00:19:35

On 22 February 2016 at 07:05, Stephen Hemminger
[off-list ref] wrote:
On Fri, 19 Feb 2016 20:12:04 +1100
Marcus Furlong [off-list ref] wrote:
quoted
Hi,

Just wondering if the following command should work:

# ip route add 192.168.27.27/24 dev eth0 scope link src 192.168.27.27
RTNETLINK answers: Invalid argument

However, this command works:

# ip route add 192.168.27.0/24 dev eth0 scope link src 192.168.27.27

192.168.27.0/24 and 192.168.27.27/24 describe the same subnet?
It is the kernel complaining, not ip command.
The kernel will not accept 192.168.27.27/24 as route since it is a full
network address, not an network prefix.
Would it be a bad idea for the ip command to validate the data, and
only submit the network bits to the kernel?

Regards,
Marcus.

-- 
Marcus Furlong
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help