Replacements for Linux Commands : Part 2


So moving further with our FIRST PART , lets move onwards.

Iwconfig



Deprecated iwconfig commands

Replacement

iwconfig
.
Displays basic details about wireless interfaces, such as supported protocols (802.11a/b/g/n), Extended Service Set ID (ESSID), mode, and access point. To view these details about a particular interface, use iwconfig [interface] where the interface is the device name, such as wlan0.
iw dev [interface] link
iwconfig [interface] ap [address]
.
Forces the wireless adapter to register with the access point given by the [address], if possible. This address is the cell identity of the access point (as reported by wireless scanning) which may be different from its MAC address.
Not apparent
iwconfig commit
.
Some wireless adapters may not apply changes immediately (they may wait to aggregate the changes, or apply them only when the card is brought up via ifconfig). This command (when available) forces the adapter to immediately apply all pending changes.
Not apparent
iwconfig [interface] essid [name]
.
Connects to the WLAN with the ESSID [name] provided. With some wireless adapters, you can disable the ESSID checking (ESSID promiscuous) with off or any (and on to re-enable it).
iw [interface] connect [name]
iwconfig [interface] frag [num]
.
Sets the maximum fragment size which is always lower than the maximum packet size. This parameter may also control Frame Bursting available on some wireless adapters (the ability to send multiple IP packets together). This mechanism would be enabled if the fragment size is larger than the maximum packet size. Other valid frag parameters to auto, on, and off.
Not apparent
iwconfig [interface] [freq | channel]
.
Sets the operating frequency or channel on the wireless device. A value below 1000 indicates a channel number, a value greater than 1000 is a frequency in Hz. You can append the suffix k, M or G to the value (for example, “2.46G” for 2.46 GHz frequency). You may also use off or auto to let the adapter pick up the best channel (when supported).
iw dev [interface] set freq [freq] [HT20|HT40+|HT40-]
.
iw dev [interface] set channel [chan] [HT20|HT40+|HT40-]
iwconfig [interface] key [key] [mode] [on | off]
.
To set the current encryption [key], just enter the key in hex digits as XXXX-XXXX-XXXX-XXXX or XXXXXXXX. You can also enter the key as an ASCII string by using the s: prefix. On and off re=enable and disable encryption. The security mode may be open or restricted, and its meaning depends on the card used. With most cards, in open mode no authentication is used and the card may also accept non-encrypted sessions, whereas in restricted mode only encrypted sessions are accepted and the card will use authentication if available.
iw [interface] connect [name] keys [key] (for WEP)
.
To connect to an AP with WPA or WPA2 encryption, you must use wpa_supplicant.
iwconfig [interface] mode [mode]
.
Sets the operating mode of the wireless device. The [mode] can be Ad-Hoc, Auto, Managed, Master, Monitor, Repeater, or Secondary.
.
Ad-Hoc
: the network is composed of only one cell and without an access point.
Managed: the wireless node connects to a network composed of many access points, with roaming.
Master: the wireless node is the synchronization master, or it acts as an access point.
Monitor: the wireless node is not associated with any cell and passively monitors all packets on the frequency.
Repeater: the wireless node forwards packets between other wireless nodes.
Secondary: the wireless node acts as a backup master/repeater.
Not apparent
iwconfig [interface] modu [modulation]
.
Forces the wireless adapter to use a specific set of modulations. Modern adapters support various modulations, such as 802.11b or 802.11g. The list of available modulations depends on the adapter/driver and can be displayed using iwlist modulation. Some options are 11g, CCK OFDMa, and auto.
Not apparent
iwconfig [interface] nick [name]
.
Sets the nick name (or station name).
Not apparent
iwconfig [interface] nwid [name]
.
Sets the Network ID for the WLAN. This parameter is only used for pre-802.11 hardware as the 802.11 protocol uses the ESSID and access point address for this function. With some wireless adapters, you can disable the Network ID checking (NWID promiscuous) with off (and on to re-enable it).
Not apparent
iwconfig [interface] power [option]
iwconfig [interface] power min | max [secondsu | secondsm]
iwconfig [interface] power mode [mode]
iwconfig [interface] power on | off

.
Configures the power management scheme and mode. Valid [options] are: period [value] (sets the period between wake ups), timeout [value] (sets the timeout before going back to sleep), saving [value] (sets the generic level of power saving).
The min and max modifiers are in seconds by default, but append the suffices m or u to specify values in milliseconds or microseconds.
Valid [mode] options are: all (receive all packets), unicast (receive unicast packets only, discard multicast and broadcast) and multicast (receive multicast and broadcast only, discard unicast packets).
On and off re-enable or disable power management.
Not apparent; some power commands are:
.
iw dev [interface] set power_save on
.

iw dev [interface] get power_save
iwconfig [interface] rate/bit [rate]
.
Sets the bit rate in bits per second for cards supporting multiple bit rates. The bit-rate is the speed at which bits are transmitted over the medium, the user speed of the link is lower due to medium sharing and various overhead.Suffixes k, M or G can be added to the numeric [rate] (decimal multiplier : 10^3, 10^6 and 10^9 b/s), or add ‘0‘ for enough. The [rate] can also be auto to select automatic bit-rate mode (fallback to lower rate on noisy channels), or fixed to revert back to fixed setting. If you specify a bit-rate numeric value and append auto, the driver will use all bit-rates lower and equal than this value.
iw [interface] set bitrates legacy-2.4 12 18 24
iwconfig [interface] retry [option] [value]
.
To set the maximum number of retries (MAC retransmissions), enter limit [value]. To set the maximum length of time the MAC should retry, enter lifetime [value]. By default, this value is in seconds; append the suffices m or u to specify values in milliseconds or microseconds. You can also add the short, long, min and max modifiers.
Not apparent
iwconfig [interface] rts [threshold]
.
Sets the size of the smallest packet for which the node sends RTS; a value equal to the maximum packet size disables the mechanism. You may also set the threshold parameter to auto, fixed or off.
Not apparent
iwconfig [interface] sens [threshold]
.
Sets the sensitivity threshold (defines how sensitive the wireless adapter is to poor operating conditions such as low signal, signal interference, etc). Modern adapter designs seem to control these thresholds automatically.
Not apparent
iwconfig [interface] txpower [value]
.
For adapters supporting multiple transmit powers, this sets the transmit power in dBm. If W is the power in Watt, the power in dBm is P = 30 + 10.log(W). If the [value] is postfixed by mW, it will be automatically converted to dBm. In addition, on and off enable and disable the radio, and auto and fixed enable and disable power control (if those features are available).
iw dev [interface] set txpower [auto | fixed | |limit] [tx power in mBm]
.
iw phy [phyname] set txpower [auto | fixed | limit] [tx power in mBm]
iwconfig –help
.
Displays the iwconfig help message.
iw help
iwconfig –version
.
Displays the version of iwconfig installed.
iw –version
Some examples of the iw command syntax are as follows.
# iw dev wlan0 link
# iw wlan0 connect CoffeeShopWLAN
# iw wlan0 connect HomeWLAN keys 0:abcde d:1:0011223344 (for WEP)


Nameif

Deprecated nameif commands

Replacement

nameif [name] [mac_address]
.
If no name and MAC address are provided, it attempts to read addresses from /etc/mactab. Each line of mactab should contain an interface name and MAC address (or comments starting with #).
ip link set dev [interface] name [name]
.
ifrename -i [interface] -n [newname]
nameif -c [config_file]
.
Reads from [config_file] instead of /etc/mactab.
ifrename -c [config_file]
nameif -s
.
Error messages are sent to the syslog.
Not apparent

Netstat

Deprecated netstat commands

Replacement

netstat -a or –all
.
Shows both listening and non-listening sockets.
ss -a or –all
netstat -A [family] or –protocol=[family]
.
Specifies the address families for which connections are to be shown. [family] is a comma separated list of address family keywords like inet, unix, ipx, ax25, netrom, and ddp. This has the same effect as using the –inet, –unix (-x), –ipx, –ax25, –netrom, and –ddp options.
ss -f [family] or –family=[family]
.
Families: unix, inet, inet6, link, netlink.
netstat -c or –continuous
.
Configures netstat to refresh the displayed information every second until stopped.
Not apparent
netstat -C
.
Prints routing information from the route cache.
ip route list cache
netstat -e or –extend
.
Displays an increased level of detail. Can be entered as twice (as –ee) for maximum details.
ss -e or –extended
netstat -F
.
Prints routing information from the forward information database (FIB).
Not apparent
netstat -g or –groups
.
Displays multicast group membership information for IPv4 and IPv6.
ip maddr, ip maddr show [interface]
netstat -i or –interface=[name]
.
Displays a table of all network interfaces, or the specified [name].
ip -s link
netstat -l or –listening
.
Shows only listening sockets (which are omitted by netstat be default).
ss -l or –listening
netstat -M or –masquerade
.
Displays a list of masqueraded connections (connections being altered by Network Address Translation).
Not apparent
netstat -n or –numeric
.
Show numerical addresses instead of trying to determine symbolic host, port or user names (skips DNS translation).
ss -n or –numeric
netstat –numeric-hosts
.
Shows numerical host addresses but does not affect the resolution of port or user names.
Not apparent
netstat –numeric ports
.
Shows numerical port numbers but does not affect the resolution of host or user names.
Not apparent
netstat –numeric-users
.
Shows numerical user IDs but does not affect the resolution of host or port names.
Not apparent
netstat -N or –symbolic
.
Displays the symbolic host, port, or user names instead of numerical representations. Netstat does this by default.
ss -r or –resolve
netstat -o or –timers
.
Includes information related to networking timers.
ss -o or –options
netstat -p or –program
.
Shows the process ID (PID) and name of the program to which each socket belongs.
ss -p
netstat -r or –route
.
Shows the kernel routing tables.
ip route, ip route show all
netstat -s or –statistics
.
Displays summary statistics for each protocol.
ss -s
netstat -t or –tcp
.
Filters results to display TCP only.
ss -t or –tcp
netstat -T or –notrim
.
Stops trimming long addresses.
Not apparent
netstat -u or –udp
.
Filters results to display UDP only.
ss -u or –udp
netstat -v or –verbose
.
Produces verbose output.
Not apparent
netstat -w or –raw
.
Filter results to display raw sockets only.
ss-w or –raw
netstat -Z or –context
.
Prints the SELinux context if SELinux is enabled. On hosts running SELinux, all processes and files are labeled in a way that represents security-relevant information. This information is called the SELinux context.
Not apparent

Click here to go to Next part : Part 3

0 Responses to “Replacements for Linux Commands : Part 2”

Post a Comment