Discussion:
ip addr add vs. interface alias
(too old to reply)
k***@gmail.com
2007-04-10 10:09:06 UTC
Permalink
Hi!

Just wondering what the differences between using "ip addr add ..."
and defining an interface alias with "ifconfig eth0:0 ..." are.

Any (dis)advantages in either method?

Any experiences?

Thanx
Kianusch
Damian 'legion' Szuberski
2007-04-10 16:07:57 UTC
Permalink
Post by k***@gmail.com
Just wondering what the differences between using "ip addr add ..."
and defining an interface alias with "ifconfig eth0:0 ..." are.
Aliases have been in use in times before Christ - they define different
interfaces (so different routing rules, tc, firewall...).
ip addr is reasonable approach to 'one if, several addresses' problem.
Use the latter only or mess with inconvenient problems that arise.
Post by k***@gmail.com
Any (dis)advantages in either method?
Any experiences?
As I wrote above.
--
Damian Szuberski
Pascal Hambourg
2007-04-10 18:10:14 UTC
Permalink
Hello,
Post by Damian 'legion' Szuberski
Post by k***@gmail.com
Just wondering what the differences between using "ip addr add ..."
and defining an interface alias with "ifconfig eth0:0 ..." are.
Aliases have been in use in times before Christ - they define different
interfaces (so different routing rules, tc, firewall...).
No they don't - at list on Linux. The eth0:0 thing is not an interface
but only a kind of label associated to the address. The label does not
exist for kernel networking functions such as routing, packet filtering
and so on. Only the real interface and its addresses (including the
aliases) exist.

Once created, I have not seen any operational difference between aliases
created by ifconfig and addresses added by "ip addr". Both add addresses
and direct routes to network interfaces. However addresses created by
"ip addr" without an explicit label (default label is the interface
name) do no show in ifconfig (but it works the same). Also, alias
handling in ifconfig is somehow inconsistant : you set the label DOWN
(like an interface, which it is not) to delete it.

Note that you can also add an IP address to an interface (and create an
alias) with "ifconfig ethX add...".
patrick
2007-04-10 19:14:28 UTC
Permalink
Post by Pascal Hambourg
Post by Damian 'legion' Szuberski
Post by k***@gmail.com
Just wondering what the differences between using "ip addr add ..."
and defining an interface alias with "ifconfig eth0:0 ..." are.
Aliases have been in use in times before Christ - they define
different interfaces (so different routing rules, tc, firewall...).
No they don't - at list on Linux. The eth0:0 thing is not an interface
but only a kind of label associated to the address.
Pascal, you are arguing pure semantics here. A virtual interface (a.k.a.
"alias") is what is being discussed.
Damian 'legion' Szuberski
2007-04-10 20:16:55 UTC
Permalink
Post by Pascal Hambourg
Hello,
Hi
Post by Pascal Hambourg
Post by Damian 'legion' Szuberski
Post by k***@gmail.com
Just wondering what the differences between using "ip addr add ..."
and defining an interface alias with "ifconfig eth0:0 ..." are.
Aliases have been in use in times before Christ - they define different
interfaces (so different routing rules, tc, firewall...).
No they don't - at list on Linux. The eth0:0 thing is not an interface
but only a kind of label associated to the address. The label does not
exist for kernel networking functions such as routing, packet filtering
and so on. Only the real interface and its addresses (including the
aliases) exist.
Sorry for mistake, you're right. I should hold my horses. Actually
aliases have inconsistent syntax and behaviour, exactly as you pointed.
Sometimes they behave like different device, sometimes like just one
another address. Anyway avoid them...
--
Damian Szuberski
Loading...