1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Linux Professional Institute Certification — 102 Angus Lees gus@inodes.org Geoffrey Robertson ge@ffrey.com Nick Urbanik nicku@nicku.org 2005 July Description of Objective 1.112.3 TCP/IP configuration and troubleshooting 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson Candidates should be able to view, change and verify configuration settings and operational status for various network interfaces. This objective includes manual and automatic configuration of interfaces and routing tables. This especially means to add, start, stop, restart, delete or reconfigure network interfaces. It also means to change, view or configure the routing table and to correct an improperly set default route manually. Candidates should be able to configure Linux as a DHCP client and a TCP/IP host and to Key files, terms, and utilities include: 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson /etc/HOSTNAME or /etc/hostname /etc/hosts /etc/networks /etc/host.conf /etc/resolv.conf /etc/nsswitch.conf ifconfig route dhcpcd, dhcpclient, pump host hostname (domainname, dnsdomainname) netstat ping traceroute tcpdump the network scripts run during system initializat TCP/IP Configuration and Troubleshooting Objective 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson Candidates should be able to view, change and verify configuration settings and operational status for various network interfaces. This objective includes manual and automatic configuration of interfaces and routing tables. This especially means to add, start, stop, restart, delete or reconfigure network interfaces. It also means to change, view or configure the routing table and to correct an improperly set default route manually. Candidates should be able to configure Linux as a DHCP client and a TCP/IP host and to debug problems associated with the network configuration. Weight: 7 TCP/IP Configuration and Troubleshooting Key files, terms, and utilities 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson /etc/HOSTNAME or /etc/hostname ifconfig /etc/hosts route /etc/networks netstat /etc/host.conf host /etc/resolv.conf ping /etc/nsswitch.conf tcpdump traceroute dhcpcd, dhcpclient, pump hostname (domainname, dnsdomainname) the network scripts run during system initialisation TCP/IP Configuration and Troubleshooting Resources of Interest 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson Linux Networking HOWTO by Joshua Drake : http://www.linuxdoc.org/HOWTO/ Net-HOWTO/index.html Linux Ethernet-Howto by Paul Gortmaker : http://www.linuxdoc.org/HOWTO/ Ethernet-HOWTO.html 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson Network interface configuration ifconfig eth0 192.168.7.26 netmask 255.255.255.0 broadcast 192.168.7.255 ifconfig eth0 down 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson route add -net 192.168.7.0 netmask 255.255.255.0 dev eth0 route add default gw 192.168.7.1 View routing table: route -n 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson Ports in use Routing table Interfaces Multicast groups Masqueraded connections Statistics netstat -a -u -t netstat -r netstat -i netstat -g netstat -M netstat -s 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson ping Try to bounce an ICMP packet off a host Good for reachability, round trip delay, packet loss traceroute Show the network path to a particular host Good for testing routing problems, “which ISP screwed up” tcpdump Dump raw network traffic Exceptional for diagnosing network problems involving a particular host 1.112.3 TCP/IP configuration and troubleshooting Weight 7 Geoff Robertson tcpdump is your friend, learn to use it # tcpdump -i ppp0 not port ssh tcpdump: listening on ppp0 21:54:32.913475 10.0.128.107.1024 > 10.0.128.97.domain: 21:54:33.102745 10.0.128.97.domain > 10.0.128.107.1024: 21:54:33.103766 10.0.128.107 > 203.26.250.2: icmp: echo 21:54:33.352745 203.26.250.2 > 10.0.128.107: icmp: echo 21:54:34.102912 10.0.128.107 > 203.26.250.2: icmp: echo 21:54:34.302745 203.26.250.2 > 10.0.128.107: icmp: echo 21:56:09.908636 10.0.128.107.1068 > 203.26.250.2.www: S 21:56:10.052743 203.26.250.2.www > 10.0.128.107.1068: S 21:56:10.052869 10.0.128.107.1068 > 203.26.250.2.www: . 21:56:12.977510 10.0.128.107.1068 > 203.26.250.2.www: P 20147+ A? fatso.urnet.com.a 20147* 1/3/3 (178) (DF) request (DF) reply request (DF) reply 1245080954:1245080954(0) win 3633684004:3633684004(0) ack ack 1 win 5840 , Geoffrey Robertson and Nick Urbanik . Permission is granted to make and distribute verbatim copies or modified versions of this document provided that this copyright notice and this permission notice are preserved on all copies under the terms of the GNU General Public License as published by the Free Software Foundation—either version 2 of the License or (at your option) any later version.