Linux Networking Setup and Diagnostics Tutorial

This tutorial is intentionally short to help you catch up with previous tutorials. Make sure you scan the reference documentation using the man command for the commands below.

1. Use the ifconfig(8) command to identify the IP address on 2 Linux PCs connected to the same network. It can also be used to configure network adaptor and IP settings, though nowadays on a desktop you would normally use GUI wizards to configure networking, unless you are working on a Linux server or embedded system with no GUI.

2. Use ping(8) on both PCs to check that IP traffic can be routed between these PCs. ping has return codes and options which enable it to be used from a shell script to check a network connection is open before attempting an automated network operation or file transfer.

3. Use ps(1) to check whether either or both PCs are running sshd(8), the secure shell server. If not installed, the Debian/Ubuntu command to install it is apt-get install openssh-server

4. If possible use ssh(1) to initiate a remote login and use sftp(1) to transfer files between the 2 computers.

5. The dig(1) command can be used to explore the contents of DNS records and servers. The file /etc/resolve.conf can be used manually to install DNS server IP addresses. If dig isn't installed on your Debian/Ubuntu system it can be installed using the command: sudo apt-get install dig

6. If you can identify a network connected sendmail server, or any other SMTP relay, e.g. qmail, exim, postfix, attempt getting it to relay a test mail message by establishing a telnet connection to port 25 on the server with the mail relay. Most SMTP relays will respond to commands such as HELO, HELP, MAIL From: address, and RCPT To: address. You can send the mail message itself using the DATA command followed by the text of the message, followed by a dot (.) on a line by itself. Use a mail user agent e.g. mail(1) on the machine to which the message was sent to check if it was delivered. MS-Windows also has a telnet command with which you can investigate text-based network services.