* link-local address via ifconfig
@ 2006-06-03 2:57 Anand Kumria
2006-06-03 4:55 ` Herbert Xu
2006-06-12 14:02 ` Ingo Oeser
0 siblings, 2 replies; 3+ messages in thread
From: Anand Kumria @ 2006-06-03 2:57 UTC (permalink / raw)
To: netdev
Hi,
There are plenty of people who still use ifconfig to list the addresses
assigned to their network interfaces (I know, ifconfig is broken) and
who then parse the output.
However the kernel puts link-local scoped address first if the address
list of an interface, so an interface like:
eve:[~]% ip addr show wlan0
3: wlan0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
link/ether 00:12:f0:03:d9:e7 brd ff:ff:ff:ff:ff:ff
inet 169.254.182.108/16 brd 169.254.255.255 scope link wlan0
inet 192.168.2.2/24 brd 192.168.2.255 scope global wlan0
inet6 fe80::212:f0ff:fe03:d9e7/64 scope link
valid_lft forever preferred_lft forever
appears as:
eve:[~]% ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:12:F0:03:D9:E7
inet addr:169.254.182.108 Bcast:169.254.255.255 Mask:255.255.0.0
inet6 addr: fe80::212:f0ff:fe03:d9e7/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
[... elided ...]
Is there any reason to put the link-local address first in the list?
I've had a number of bugreports (or outright panic attacks) where the
problem turned out to be that ifconfig was reporting the link-local
address first, rather than the global/site one.
Thanks,
Anand
--
`When any government, or any church for that matter, undertakes to say to
its subjects, "This you may not read, this you must not see, this you are
forbidden to know," the end result is tyranny and oppression no matter how
holy the motives' -- Robert A Heinlein, "If this goes on --"
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: link-local address via ifconfig
2006-06-03 2:57 link-local address via ifconfig Anand Kumria
@ 2006-06-03 4:55 ` Herbert Xu
2006-06-12 14:02 ` Ingo Oeser
1 sibling, 0 replies; 3+ messages in thread
From: Herbert Xu @ 2006-06-03 4:55 UTC (permalink / raw)
To: Anand Kumria; +Cc: netdev
Anand Kumria <wildfire@progsoc.uts.edu.au> wrote:
>
> There are plenty of people who still use ifconfig to list the addresses
> assigned to their network interfaces (I know, ifconfig is broken) and
> who then parse the output.
If people insist on using hammers on screws, the answer is not to improve
the hammer.
Cheers,
--
Visit Openswan at http://www.openswan.org/
Email: Herbert Xu ~{PmV>HI~} <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: link-local address via ifconfig
2006-06-03 2:57 link-local address via ifconfig Anand Kumria
2006-06-03 4:55 ` Herbert Xu
@ 2006-06-12 14:02 ` Ingo Oeser
1 sibling, 0 replies; 3+ messages in thread
From: Ingo Oeser @ 2006-06-12 14:02 UTC (permalink / raw)
To: Anand Kumria; +Cc: netdev
Hi Anand,
Anand Kumria wrote:
> There are plenty of people who still use ifconfig to list the addresses
> assigned to their network interfaces (I know, ifconfig is broken) and
> who then parse the output.
>
> However the kernel puts link-local scoped address first if the address
> list of an interface, so an interface like:
> Is there any reason to put the link-local address first in the list?
>
> I've had a number of bugreports (or outright panic attacks) where the
> problem turned out to be that ifconfig was reporting the link-local
> address first, rather than the global/site one.
This can be worked around by defining an "alias interface" this way
"ip address add 169.254.182.108/16 brd 169.254.255.255 scope link dev eth0 label eth0:0"
(see: "label eth0:0" is appended)
So in reality this is no problem for users.
Regards
Ingo Oeser
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-06-12 14:02 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-03 2:57 link-local address via ifconfig Anand Kumria
2006-06-03 4:55 ` Herbert Xu
2006-06-12 14:02 ` Ingo Oeser
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).