Aliases
Is their a limit on the number of alias interfaces you can have under 2.4?
I haven't run into it yet, and yesterday I setup a box with >1700
David Lang
Quoted 12 lines · On Thu, 16 Aug 2001 [email protected] wrote:
Date: Thu, 16 Aug 2001 17:11:27 -0400
From: [email protected]
To: [email protected]
Subject: AliasesIs their a limit on the number of alias interfaces you can have under 2.4? -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Having recently gone from 2.2 to 2.4 what's the device convention now? I thought it was eth0 (example) and eth0:0 .. eth0:255, but knew kernel 2.4 would take it further.
----- Original Message -----
From: "dlang" <[email protected]>
To: <[email protected]>
Cc: <[email protected]>
Sent: Thursday, August 16, 2001 9:48 PM
Subject: Re: Aliases
Quoted 14 lines
I haven't run into it yet, and yesterday I setup a box with >1700
David Lang
Quoted 6 lines · On Thu, 16 Aug 2001 [email protected] wrote:
Date: Thu, 16 Aug 2001 17:11:27 -0400
From: [email protected]
To: [email protected]
Subject: AliasesIs their a limit on the number of alias interfaces you can have under
2.4?
Quoted 2 lines
Quoted 2 lines
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel"
in
Quoted 11 lines
Quoted 4 lines
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 3 lines · Jim Roland
Having recently gone from 2.2 to 2.4 what's the device convention now? I thought it was eth0 (example) and eth0:0 .. eth0:255, but knew kernel 2.4 would take it further.
presuming this isn't an ifconfig limit instead of a kernel limit, trying "ifconfig eth0:x" works for x < 10000, anything > 10000 and x becomes x%10000.
However, 2.4 also has multiple addresses of the same type per device; unfortunately it's fairly slow. Adding or deleting addresses seems to take ~5 seconds per 255 addresses on my machine, and listing addresses takes about 1 second / 300 addresses on the same machine.
Also, listing addresses for another interface isn't any faster, which is unfortunate; ip shouldn't need to check addresses of all interfaces just to get the ones for the requested interface.
At least listing time seems to increase linearly with the number of addresses. IIRC someone posted a patch a few weeks ago to speed this up (no longer sits for a long time before listing addresses).
time ip addr show dev eth1 | wc -l
37766
ip addr show dev eth1 113.17s user 1.82s system 99% cpu 1:55.38 total
Also, ifconfig, which has no idea about any but the first address in an address class, also does nothing for the same amount of time before listing interfaces.
Anyway, it seems ip and the 2.4 scheme with multiple addresses per interface can handle many more addresses than ifconfig and the device alias scheme.
justin
Quoted 3 lines · Justin Guyett
presuming this isn't an ifconfig limit instead of a kernel limit, trying "ifconfig eth0:x" works for x < 10000, anything > 10000 and x becomes x%10000.
must be a limit in your version of ifconfig.
# ifconfig --version net-tools 1.60 ifconfig 1.42 (2001-04-13)
# ifconfig lo:10001 127.0.0.2
# ifconfig lo:20001 127.0.0.3
# ifconfig lo:10001
lo:10001 Link encap:Local Loopback
inet addr:127.0.0.2 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1# ifconfig lo:20001
lo:20001 Link encap:Local Loopback
inet addr:127.0.0.3 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1Quoted 4 lines
However, 2.4 also has multiple addresses of the same type per device; unfortunately it's fairly slow. Adding or deleting addresses seems to take ~5 seconds per 255 addresses on my machine, and listing addresses takes about 1 second / 300 addresses on the same machine.
I can raise 1000 interfaces in 1.6 seconds with 2.4.8 on a 500MHz PIII using my custom written ifconfig program designed for raising a batch of IPS in one go. I've actually got up to about 64000 IPs on one interface but performance degrades rapidly after about 8000 probably due to the kernel ip hash size - i didn't try any higher than this. Anybody wanting more than a Class B of ip aliases on one machine has gotta have some sort of problem so I don't think its really an issue.
# time ./vifup -q -f ip.list internal available interfaces for internal network: eth1 raised 1020 of 1020
real 0m1.671s
user 0m0.820s
sys 0m0.850s
Quoted 3 lines
Also, listing addresses for another interface isn't any faster, which is unfortunate; ip shouldn't need to check addresses of all interfaces just to get the ones for the requested interface.
It does need to. The kernel ioctl SIOCGIFCONF only lets you fetch info for all interfaces so you have to search through the whole lot to find the ones your interested in. This is a standard BSD interface - or is there a new interface used by ip??.
~mc
Quoted 7 lines · Justin Guyett
Quoted 3 lines
Having recently gone from 2.2 to 2.4 what's the device convention now? I thought it was eth0 (example) and eth0:0 .. eth0:255, but knew kernel 2.4 would take it further.
presuming this isn't an ifconfig limit instead of a kernel limit, trying "ifconfig eth0:x" works for x < 10000, anything > 10000 and x becomes x%10000.
For various reasons interfaces aliases are deprecated. The recommended way of doing things these days is just adding more addresses to an interface with the ip(8) program from the iproute package. It works like:
ip addr add 192.168.2.0/24 broadcast 192.168.2.255 scope host dev eth0
Quoted 4 lines
However, 2.4 also has multiple addresses of the same type per device; unfortunately it's fairly slow. Adding or deleting addresses seems to take ~5 seconds per 255 addresses on my machine, and listing addresses takes about 1 second / 300 addresses on the same machine.
It seems you've tried to add individual addresses, one by one. That's not necessary, you can add the addresses of a whole subnet to the kernel. If you have a large network that's dramatically faster and easier to administrate.
Quoted 11 lines
Also, listing addresses for another interface isn't any faster, which is unfortunate; ip shouldn't need to check addresses of all interfaces just to get the ones for the requested interface.
At least listing time seems to increase linearly with the number of addresses. IIRC someone posted a patch a few weeks ago to speed this up (no longer sits for a long time before listing addresses).
time ip addr show dev eth1 | wc -l
37766
ip addr show dev eth1 113.17s user 1.82s system 99% cpu 1:55.38 total
That's crude abuse unless your IPs are actually non-contiguous in address space - which they're almost certainly not.
Quoted 3 lines
Also, ifconfig, which has no idea about any but the first address in an address class, also does nothing for the same amount of time before listing interfaces.
ifconfig is deprecated as it permits you only access to a small part of power of the current Linux networking; ip is the recommended replacement.
Quoted 3 lines
Anyway, it seems ip and the 2.4 scheme with multiple addresses per interface can handle many more addresses than ifconfig and the device alias scheme.
Try ``ip addr add 10.0.0.0/8 broadcast 10.255.255.255 scope host dev eth0'' with interface aliases :-)
Ralf
the problem with adding an entire netblock to an interface is that you frequently have a gateway on that netblock that belongs to another machine so you want to add 253 out of 256 addresses to your machine.
how do you do that easily?
example gateway is 192.168.1.1 and you want the rest of the 192.168.1.x network aliased on the machine.
David Lang
On
Quoted 68 lines · Ralf Baechle
Date: Sat, 18 Aug 2001 14:32:32 +0200
From: Ralf Baechle <[email protected]>
To: Justin Guyett <[email protected]>
Cc: Jim Roland <[email protected]>, [email protected]
Subject: Re: AliasesQuoted 7 lines · Justin Guyett
Quoted 3 lines
Having recently gone from 2.2 to 2.4 what's the device convention now? I thought it was eth0 (example) and eth0:0 .. eth0:255, but knew kernel 2.4 would take it further.
presuming this isn't an ifconfig limit instead of a kernel limit, trying "ifconfig eth0:x" works for x < 10000, anything > 10000 and x becomes x%10000.
For various reasons interfaces aliases are deprecated. The recommended way of doing things these days is just adding more addresses to an interface with the ip(8) program from the iproute package. It works like:
ip addr add 192.168.2.0/24 broadcast 192.168.2.255 scope host dev eth0
Quoted 4 lines
However, 2.4 also has multiple addresses of the same type per device; unfortunately it's fairly slow. Adding or deleting addresses seems to take ~5 seconds per 255 addresses on my machine, and listing addresses takes about 1 second / 300 addresses on the same machine.
It seems you've tried to add individual addresses, one by one. That's not necessary, you can add the addresses of a whole subnet to the kernel. If you have a large network that's dramatically faster and easier to administrate.
Quoted 11 lines
Also, listing addresses for another interface isn't any faster, which is unfortunate; ip shouldn't need to check addresses of all interfaces just to get the ones for the requested interface.
At least listing time seems to increase linearly with the number of addresses. IIRC someone posted a patch a few weeks ago to speed this up (no longer sits for a long time before listing addresses).
time ip addr show dev eth1 | wc -l
37766
ip addr show dev eth1 113.17s user 1.82s system 99% cpu 1:55.38 totalThat's crude abuse unless your IPs are actually non-contiguous in address space - which they're almost certainly not.
Quoted 3 lines
Also, ifconfig, which has no idea about any but the first address in an address class, also does nothing for the same amount of time before listing interfaces.
ifconfig is deprecated as it permits you only access to a small part of power of the current Linux networking; ip is the recommended replacement.
Quoted 3 lines
Anyway, it seems ip and the 2.4 scheme with multiple addresses per interface can handle many more addresses than ifconfig and the device alias scheme.
Try ``ip addr add 10.0.0.0/8 broadcast 10.255.255.255 scope host dev eth0'' with interface aliases :-)
Ralf
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Try before you buy.
# ip a a 192.168.0.0/24 brd + dev eth0 # ip r a 192.168.0.1/32 via 208.179.59.1 dev eth0
# ip r g 192.168.0.1 192.168.0.1 via 208.179.59.1 dev eth0 src 208.179.59.2 cache mtu 1500 advmss 1460
# ip r g 192.168.0.2 192.168.0.2 dev eth0 src 192.168.0.0 cache mtu 1500 advmss 1460
David
Quoted 9 lines · David Lang
the problem with adding an entire netblock to an interface is that you frequently have a gateway on that netblock that belongs to another machine so you want to add 253 out of 256 addresses to your machine.
how do you do that easily?
example gateway is 192.168.1.1 and you want the rest of the 192.168.1.x network aliased on the machine.
where can I get the iproute package mentioned below. I just double checked slackware 8.0 and it isn't included.
David Lang
Quoted 68 lines · Ralf Baechle
Date: Sat, 18 Aug 2001 14:32:32 +0200
From: Ralf Baechle <[email protected]>
To: Justin Guyett <[email protected]>
Cc: Jim Roland <[email protected]>, [email protected]
Subject: Re: AliasesQuoted 7 lines · Justin Guyett
Quoted 3 lines
Having recently gone from 2.2 to 2.4 what's the device convention now? I thought it was eth0 (example) and eth0:0 .. eth0:255, but knew kernel 2.4 would take it further.
presuming this isn't an ifconfig limit instead of a kernel limit, trying "ifconfig eth0:x" works for x < 10000, anything > 10000 and x becomes x%10000.
For various reasons interfaces aliases are deprecated. The recommended way of doing things these days is just adding more addresses to an interface with the ip(8) program from the iproute package. It works like:
ip addr add 192.168.2.0/24 broadcast 192.168.2.255 scope host dev eth0
Quoted 4 lines
However, 2.4 also has multiple addresses of the same type per device; unfortunately it's fairly slow. Adding or deleting addresses seems to take ~5 seconds per 255 addresses on my machine, and listing addresses takes about 1 second / 300 addresses on the same machine.
It seems you've tried to add individual addresses, one by one. That's not necessary, you can add the addresses of a whole subnet to the kernel. If you have a large network that's dramatically faster and easier to administrate.
Quoted 11 lines
Also, listing addresses for another interface isn't any faster, which is unfortunate; ip shouldn't need to check addresses of all interfaces just to get the ones for the requested interface.
At least listing time seems to increase linearly with the number of addresses. IIRC someone posted a patch a few weeks ago to speed this up (no longer sits for a long time before listing addresses).
time ip addr show dev eth1 | wc -l
37766
ip addr show dev eth1 113.17s user 1.82s system 99% cpu 1:55.38 totalThat's crude abuse unless your IPs are actually non-contiguous in address space - which they're almost certainly not.
Quoted 3 lines
Also, ifconfig, which has no idea about any but the first address in an address class, also does nothing for the same amount of time before listing interfaces.
ifconfig is deprecated as it permits you only access to a small part of power of the current Linux networking; ip is the recommended replacement.
Quoted 3 lines
Anyway, it seems ip and the 2.4 scheme with multiple addresses per interface can handle many more addresses than ifconfig and the device alias scheme.
Try ``ip addr add 10.0.0.0/8 broadcast 10.255.255.255 scope host dev eth0'' with interface aliases :-)
Ralf
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Quoted 2 lines · David Lang
where can I get the iproute package mentioned below. I just double checked slackware 8.0 and it isn't included.
Yeah, i always get upset when I go looking for it because it's not on freshmeat. iproute and iputils both.
ftp://ftp.inr.ac.ru/ip-routing/
justin
Quoted 8 lines
For various reasons interfaces aliases are deprecated. The recommended way of doing things these days is just adding more addresses to an interface with the ip(8) program from the iproute package. It works like:
ip addr add 192.168.2.0/24 broadcast 192.168.2.255 scope host dev eth0
You can shorten this to:
ip a a 192.168.2.0/24 brd + dev eth0
..and leaving the scope global [by default] which makes it fully reachable.
David
Quoted 11 lines · David Ford
Quoted 5 lines
For various reasons interfaces aliases are deprecated. The recommended way of doing things these days is just adding more addresses to an interface with the ip(8) program from the iproute package. It works like:
ip addr add 192.168.2.0/24 broadcast 192.168.2.255 scope host dev eth0
You can shorten this to:
ip a a 192.168.2.0/24 brd + dev eth0..and leaving the scope global [by default] which makes it fully reachable.
I did not mean to reproduce the whole over 50 pages of docs documentation in my posting.
Ralf