Skip to contentSkip to conversation

iproute2 and ethX:X subdevices

LARTC Alan Ford 3 participants 3 messages Feb 3, 2004 – Feb 4, 2004

lore
Share & tools
lore

Alan Ford

author
#0 lore raw

Hi,

Quick question -- is it possible to create eth0:0 - style psuedo-devices using the 'ip' tool?

I see they recognise them when using 'ip addr show':
5: eth2: <BROADCAST,MULTICAST,ALLMULTI,UP> mtu 1500 qdisc pfifo_fast qlen 1000

    inet 192.168.0.1/24 brd 192.168.0.255 scope global eth2:0

But I can't see a way of creating them. Is it possible?

(I know somebody may say "why would I want to" -- it's just for neatness, so that people using 'ifconfig' can still see all the addresses in use.)

Thanks,

Signature · 4 lines
Alan Ford * [email protected] 
_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/
#1 lore raw

Alan Ford, Tue, Feb 03, 2004 at 05:41:06PM +0000:

Quoted 5 lines

Hi,

Quick question -- is it possible to create eth0:0 - style psuedo-devices using the 'ip' tool?

ip addr add 10.0.0.1/24 dev eth0 label eth0:0

g

#2 lore raw
In reply to Alan Ford

Alan,

: Quick question -- is it possible to create eth0:0 - style : psuedo-devices using the 'ip' tool?

They aren't really "pseudo-devices", but we understand what you mean. In the days prior to the iproute2 tools, when a device would have one interface, which would have one IP address, they were called IP aliases.

: I see they recognise them when using 'ip addr show':
:
: 5: eth2: <BROADCAST,MULTICAST,ALLMULTI,UP> mtu 1500 qdisc pfifo_fast qlen 1000
: inet 192.168.0.1/24 brd 192.168.0.255 scope global eth2:0
:
: But I can't see a way of creating them. Is it possible?

The answer is yes, there is a way to create interfaces using the "ip address" tool, so that they are recognizable to ifconfig. You are looking for the "label" keyword to the "ip address add" command [0].

: (I know somebody may say "why would I want to" -- it's just for : neatness, so that people using 'ifconfig' can still see all the : addresses in use.)

I know exactly why an administrator would wish to do this. Some administrators, who a) have not joined the 21st century with Linux, or b) do not commonly use Linux, but rather other UNIX-like operating systems, may not know about the "ip" utility, but they certainly know about ifconfig! So, if only for the humans, this can be helpful.

-Martin

[0] http://linux-ip.net/html/tools-ip-address.html#ex-tools-ip-address-del

Signature · 5 lines
Martin A. Brown --- SecurePipe, Inc. --- [email protected]

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/