Which tool will print the current assigned IP number of an interface?
Which file is used to associate a network number to a network name?
Which file is used to assign a host IP number to a host name?
Can the netstat tool display the kernel routing tables?
What is the syntax to add a default route through the 172.16.1.1 router?
Which daemons are commonly used for dynamic routing between LANs?
Which file contains the IPs for the DNS servers
| File | Description |
|---|---|
/etc/resolv.conf | file containing a list of DNS servers used to resolve computer host names |
/etc/sysctl.conf | configuration file for the sysctl tool used
to customise kernel settings in
/proc/sys/ |
/proc/sys/net/ipv4/ip_forward | file containing information about the kernel forwarding status. The kernel will either forward or not packets that are addressed to a different host depending if the file contains a 1 or a 0 |
| Command | Description |
|---|---|
| arp | print the kernel ARP cache |
| dhcpcd | a DHCP client daemon |
| dhcpclient | a DHCP client daemon |
| ifconfig | used to configure the kernel-resident network interfaces. It is used at boot time to set up interfaces as necessary |
| netstat | prints information about network connections, routing tables, interface statistics, etc |
| ping | uses the ICMP protocol's mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. ECHO_REQUEST datagrams (pings) have an IP and ICMP header, followed by a struct timeval and then an arbitrary number of pad bytes used to fill out the packet |
| pump | is a daemon that manages network interfaces that are controlled by
either the DHCP or BOOTP protocol. While pump may be
started manually, it is normally started automatically by the
/sbin/ifup script for devices configured via
BOOTP or DHCP |
| route | manipulates the kernel's IP routing tables. Its primary use is to
set up static routes to specific hosts or networks via an interface after
it has been configured with the ifconfig program.
When the add or del options are used,
route modifies the routing tables. Without these
options, route displays the current contents of the
routing tables |
| sysctl | used to modify kernel parameters at runtime. The parameters
available are those listed under
/proc/sys/ |
| traceroute | utilizes the IP protocol time to live field and attempts to elicit an ICMP TIME_EXCEEDED response from each gateway along the path to some host |
In the Routing Scenario section (Figure 4.1, “A routing scenario:”) in this chapter, give the routing table for the LANs gateway.
Start your network interface manually
ifconfig eth0 192.168.0.x
List the kernel modules. Make sure that the eth0
module is loaded (check /etc/modules.conf).
Stop the network interface with:
ifconfig eth0 down
Verify that you can bring the interface back up without entering new information:
ifconfig eth0 up
Stop the interface and remove the kernel module
(rmmod module).
What happens if you try to bring the interface up again?
Divide the class into two networks A (192.168.1.0) and B (10.0.0.0) (see the scenaria for at least three and four hosts (see Figure 4.2, “First Scenario - at least 3 hosts” and Figure 4.3, “Second scenario - at least 4 hosts”).
Try accessing machines across networks (this shouldn't work!)
Choose an existing machine to be the gateway (on either network)
If you choose the router to be on the existing 192.168.1.0 network then do the following on that router:
create an aliased interface on the 10.0.0.0 network (x is any available number)
ifup eth0:1 10.0.0.x
allow IP forwarding
echo 1 > /proc/sys/net/ipv4/ip_forward
add a route to the other network using the gateway machine (you will need to know either the eth0 or eth0:1 setting of the gateway depending on which network you are on).
Make sure the routers force routing through the aliased interface. For example on router A:
route add -net 192.168.1.0/24 gw 172.16.0.10 dev eth0:0