Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1
wlan0                   Link    encap:Ethernet      HWaddr  00:16:ea:d4:58:88
inet addr:192.168.1.106 Bcast:192.168.1.255
Mask:255.255.255.0
inet6 addr: fe80::216:eaff:fed4:5888/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:325832 errors:0 dropped:0 overruns:0 frame:0
TX packets:302754 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:207381807 (207.3 MB) TX bytes:40442735 (40.4 MB)

This output is easily understood. The inet entry displays the IP address for
the interface. UP signifies that the interface is ready for use; BROADCAST
denotes that the interface is connected to a network that supports broadcast
messaging (ethernet); RUNNING means that the interface is operating; and
LOOPBACK shows which device (lo) is the loopback address. The maximum
transmission unit (MTU) on eth0 is 1500 bytes. This determines the size of
the largest packet that can be transmitted over this interface (and is sometimes
“tuned” to other values for performance enhancement). Metric is a number
from 0 to 3 that relates to how much information from the interface is placed
in the routing table. The lower the number, the smaller the amount of
information.


The ifconfig command can be used to display information about or


control a specific interface using commands that are listed in Table 18.1. For
example, to deactivate the first Ethernet device on a host, use the ifconfig
command, the interface name, and the command down, like this:


Click here to view code image
matthew@seymour:~$ sudo ifconfig eth0 down


You can also configure and activate the device by specifying a hostname or an
IP address and network information. For example, to configure and activate
(bring up) the eth0 interface with a specific IP address, use the ifconfig
command as follows:


Click here to view code image
matthew@seymour:~$ sudo ifconfig eth0 192.168.2.9 netmask
255.255.255.0 up


If you have a host defined in your system’s /etc/hosts file (see the
section “Network Configuration Files,” later in this chapter), you can
configure and activate the interface according to the defined hostname, like
this:


Click here to view code image

Free download pdf