Networking Forums

Networking Forums > Computer Networking > Linux Networking > ip addr add vs. interface alias

Reply
Thread Tools Display Modes

ip addr add vs. interface alias

 
 
kianusch@gmail.com
Guest
Posts: n/a

 
      04-10-2007, 10:09 AM
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

 
Reply With Quote
 
 
 
 
Damian 'legion' Szuberski
Guest
Posts: n/a

 
      04-10-2007, 04:07 PM
On 2007-04-10, (E-Mail Removed) wrote:
> 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.

> Any (dis)advantages in either method?
> Any experiences?

As I wrote above.

--
Damian Szuberski
 
Reply With Quote
 
Pascal Hambourg
Guest
Posts: n/a

 
      04-10-2007, 06:10 PM
Hello,

Damian 'legion' Szuberski a écrit :
> On 2007-04-10, (E-Mail Removed) wrote:
>
>>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...".
 
Reply With Quote
 
patrick
Guest
Posts: n/a

 
      04-10-2007, 07:14 PM
In news:evgjud$4e8$(E-Mail Removed),
Pascal Hambourg <boite-a-(E-Mail Removed)> wrote:

>>> 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.

 
Reply With Quote
 
Damian 'legion' Szuberski
Guest
Posts: n/a

 
      04-10-2007, 08:16 PM
On 2007-04-10, Pascal Hambourg wrote:
> Hello,

Hi

>>>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
 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Correct way to control alias of a NIC interface from application running as non-root Rohit Linux Networking 5 06-12-2007 09:18 PM
IP Alias default outgoing interface? agentbullvi@gmail.com Linux Networking 3 12-28-2005 06:25 PM
multicast broadcast addr innocent Linux Networking 1 04-05-2005 06:15 PM
Internet Alias/Virtual interface AcCeSsDeNiEd Linux Networking 3 01-27-2005 04:59 AM
getting IP addr from MAC address. Nirnimesh Linux Networking 3 08-14-2004 09:08 PM



1 2 3 4 5 6 7 8 9 10 11