RX packets:476 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:84965 (82.9 KiB) TX bytes:2922 (2.8 KiB)
Notice that the
3.2.1.3.2. Netmasks and routing
The netmask is used to determine which computers are on the local network, and which ones are remote and must therefore be reached through a gateway or router. These rules create the default routing table, which can be displayed with
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.97.0 * 255.255.255.0 U 0 0 0 eth0
default 172.16.97.254 0.0.0.0 UG 0 0 0 eth0
Notice that two routes have been configured. The first one states that local machines (those with IP addresses starting with 172.16.97) can be reached directly on the local network (gateway * and no G in the Flags column), and the second entry states that packets destined to any other IP address are to be sent through the router 172.16.97.254 (which is on the local network and therefore directly reachable).
The default route can be removed and added back in, pointing to a different gateway/router:
# route delete default
# route add default gw
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.97.0 * 255.255.255.0 U 0 0 0 eth0
default
When the wlan0 interface is configured, a new route is added for hosts directly accessible through that interface:
# ifconfig wlan0
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.97.0 * 255.255.255.0 U 0 0 0 eth0
192.168.9.0 * 255.255.255.0 U 0 0 0 wlan0
default 172.16.97.253 0.0.0.0 UG 0 0 0 eth0
If other networks are available through additional gateways, these can be configured by using
# route add -net
# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
172.16.97.0 * 255.255.255.0 U 0 0 0 eth0
192.168.9.0 * 255.255.255.0 U 0 0 0 wlan0
10.0.0.0 192.168.9.1 255.0.0.0 UG 0 0 0 wlan0
default 172.16.97.253 0.0.0.0 UG 0 0 0 eth0
3.2.1.3.3. DNS and hostnames
DNS resolution is controlled by the file
search fedorabook.com oreilly.com
nameserver 127.0.0.1
nameserver 216.183.93.224
There are three common option keywords used in this file:
search
A space- or tab-delimited list of domains to be searched when attempting to resolve a hostname without a domain component. In this example, if the DNS resolver were given the hostname
domain
A rarely used alternative to search that can specify only one domain. The domain and search options are mutually exclusive and cannot be used at the same time.
nameserver
The IP address of a nameserver available to resolve DNS queries. Listing multiple nameservers provides redundancy in case one of the servers is unavailable. In this example, the address for localhost (this computer) is given first, with a second nameserver entry providing the IP address of a remote nameserver as backup.
If the DNS settings are configured by DHCP, this file is overwritten automatically with the values provided by the DNS server. In that case, an additional comment line will appear at the top of the file:
; generated by /sbin/dhclient-script
To change the DNS configuration, simply edit this file with a text editor, adding or removing domains in the search line or adding or removing nameserver lines as necessary.
The
# Do not remove the following line, or various programs
# that require network functionality will fail.
::1 bluesky.fedorabook.com localhost