5

I've just installed Arch Linux on my old PC, to do the installation I used wifi-menu wlan0, now I've reboot but if I type:

ifconfig wlan0 up

I have as a result:

wlan0: ERROR while getting interface flag: no such device

I read that after the installation Arch changes the name of wlan, how can I find the new name and how could I change it?

jasonwryan
  • 71,734
  • 34
  • 193
  • 226
Mitro
  • 1,091
  • 6
  • 22
  • 37
  • 1
    Run `iwconfig`, it should tell you the names of the detected interfaces. – vonbrand Mar 11 '13 at 17:04
  • `ifconfig` and `iwconfig` are deprecated in favour of the `ip` and `iw` utilities. I can't find anything official atm to support this, but I know they're not installed on a base Arch linux system. See [here](http://dougvitale.wordpress.com/2011/12/21/deprecated-linux-networking-commands-and-their-replacements/) for a map of the old nettools family of commands to their newer counterparts from the `iproute2` package. – Alex Leach Mar 11 '13 at 18:03
  • 'iw' and 'iwconfig' give me as result -bash: iw: command not found – Mitro Mar 11 '13 at 18:41
  • Ok well, I type in the terminal dmesg and in the last lines I found the new name of my wireless (wlp0s19f5u4 WTF??) How can I change? – Mitro Mar 11 '13 at 18:48
  • 1
    Read my answer... – jasonwryan Mar 11 '13 at 19:41
  • @jasonwryan please, don't add tags focusing on the kind of answer it will gather, but in the question itself. – Braiam Apr 07 '14 at 14:51
  • 1
    @Braiam The tags I added were (a) relevant, and (b) exclusively so. What is your justification for removing them? – jasonwryan Apr 07 '14 at 17:31
  • @jasonwryan I don't see where OP mentioned any of those terms, and only see them in *your* answer. Tags are not supposed to reflect the kind of answers OP expects, but the kind of question they ask. Alex answer didn't have anything to do with systemd or hal, for example. – Braiam Apr 07 '14 at 17:46
  • 1
    @Braiam systemd and udev are how Arch does networking: OP may not be aware of that, but that is the reality. People wanting to understand how this works would benefit from more context, not an arbitrarily limited view imposed by the ignorance of the questioner. – jasonwryan Apr 07 '14 at 18:27

2 Answers2

7

From systemd v197 predictable network names were introduced.

With systemd 197 we have added native support for a number of different naming policies into systemd/udevd proper and made a scheme similar to biosdevname's (but generally more powerful, and closer to kernel-internal device identification schemes) the default.1

You can use ip link to show all of your devices.

You then have the choice of renaming any or all of those devices or continuing to use the ones that systemd/udev provide.

Should you wish to rename it/them to something that you feel more comfortable with, you can place a udev rule in /etc/udev/rules.d/ called 10-net-naming.rules, for example:

SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="20:a7:d3:68:50:g8", NAME="ether"
SUBSYSTEM=="net", ACTION=="add", ATTR{address}=="a8:c7:43:1d:f4:53", NAME="wifi"

would rename wireless and ethernet to, imaginatively, wifi and ether. You then need to update your network manager to use the new names.

There is a very detailed post on the Arch Mailing Lists announcing the change.


1.http://www.freedesktop.org/wiki/Software/systemd/PredictableNetworkInterfaceNames

jasonwryan
  • 71,734
  • 34
  • 193
  • 226
1

I don't have a wireless card on my Arch box, but I can do what you require using ip on a spare ethernet device eth1, like this:

# view network devices and addresses
$ ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether __MAC_ADDRESS__ brd __IPv6_BROADCAST__
    inet __IP_ADDRESS__/24 brd __BROADCAST__ scope global eth0
    inet6 __IPv6 ADDRESS__/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether __MAC_ADDRESS__ brd __IPv6_BROADCAST__

$ # must bring down eth1 before renaming it.
$ sudo ip link set dev eth1 down

$ # rename eth1 to ethfoo
$ sudo ip link set dev eth1 name ethfoo

$ # show 'ethfoo' device status
$ ip addr show dev ethfoo
3: ethfoo: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
    link/ether 48:5b:39:5d:89:2c brd ff:ff:ff:ff:ff:ff

$ # bring ethfoo back up
$ sudo ip link set dev ethfoo up

I imagine ip should also work identically with a wireless device, and if not, iw would hopefully provide the same functionality..

Alex Leach
  • 7,720
  • 4
  • 28
  • 27