The up argument is also unnecessary if an IP address is being specified.
The previous command can therefore be written much more simply:
# ifconfig
# ifconfig
wlan0 Link encap:Ethernet HWaddr 00:0C:2D:00:2B:DB
inet addr:192.168.9.37 Bcast:192.168.9.255 Mask:255.255.255.0
inet6 addr: fe80::20c:2dff:fe00:2bdb/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1 errors:0 dropped:0 overruns:0 frame:0
TX packets:18 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:268 (268.0 b) TX bytes:2922 (2.8 KiB)
3.2.1.3.1. Configuring wireless networks from the command line
For wireless interfaces, there are two additional commands that are useful for configuration:
# iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
sit0 no wireless extensions.
wlan0 IEEE 802.11b ESSID:'' Nickname:'zd1201'
Mode:Managed Channel:6 Access Point: 00:90:4C:7E:00:29
Bit Rate:11 Mb/s
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0/128 Signal level=60/128 Noise level:0/128
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
Here you can see that this interface has associated with an access point with a MAC address of 00:90:4C:7E:00:29, and which is apparently an 802.11b network (11 Mb/s).
To scan for available networks, use
# iwlist scan
lo Interface doesn't support scanning.
eth0 Interface doesn't support scanning.
sit0 Interface doesn't support scanning.
wlan0 Scan completed :
Cell 01 - Address: 00:90:4C:7E:00:29
ESSID:'fedorabook'
Mode:Master
Channel:11
Bit Rates:1 Mb/s
Bit Rates:2 Mb/s
Bit Rates:5.5 Mb/s
Bit Rates:11 Mb/s
Encryption key:off
Quality=60/128 Signal level=-76 dBm Noise level=-100 dBm
Cell 02 - Address: 00:87:29:13:c0:71
ESSID:'tylers'
Mode:Master
Channel:2
Bit Rates:1 Mb/s
Bit Rates:2 Mb/s
Bit Rates:5.5 Mb/s
Bit Rates:11 Mb/s
Bit Rates:18 Mb/s
Bit Rates:24 Mb/s
Bit Rates:36 Mb/s
Bit Rates:54 Mb/s
Encryption key:on
Quality=59/128 Signal level=-76 dBm Noise level=-99 dBm
To select which network wlan0 associates with, set the
# iwconfig
# iwconfig
wlan0 IEEE 802.11b ESSID:'fedorabook' Nickname:'zd1201'
Mode:Managed Channel:6 Access Point: 00:90:4C:7E:00:29
Bit Rate:11 Mb/s
Retry:off RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
Link Quality:0/128 Signal level=76/128 Noise level:0/128
Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
To disable an interface, turn it down using
# ifconfig
# ifconfig
wlan0 Link encap:Ethernet HWaddr 00:0C:2D:00:2B:DB
inet addr:192.168.9.37 Bcast:192.168.9.37 Mask:255.255.255.0
BROADCAST MULTICAST MTU:1500 Metric:1