3. Set Up Your Gnu/Linux Machine For Printing
All of the hard work is done. Now, all you have to do is to add the LPD printer on your GNU/Linux machine. After this is done, we’ll print a test page to make sure that everything works. My GNU/Linux system is a laptop running Fedora 17. This general process should work on any version of GNU/Linux, but you will have to modify the instructions accordingly.
Once you are logged on to your GNU/Linux machine, you can check to see if it can connect to port 515 on the Windows 7 machine. To do so, you’ll need to open up a terminal and become the root user by issuing the su command (this may be the sudo command on other GNU/Linux distros). You’ll then be prompted to enter your administrative password. Once you are root, you will need to install the program Nmap, if it is not already installed. Nmap is a port scanning program that can be used to scan ports on computers on your network. You can install it on Fedora 17 by typing yum install nmap and hitting Enter.
(Note: installing Nmap is completely optional, and is for printer port testing purposes only, in the scope of this article. Installing Nmap could introduce the potential security risk that if someone took control of your GNU/Linux computer, they could use Nmap to scan network ports for nefarious reasons. If you don’t feel comfortable installing port scanning software on your GNU/Linux machine, don’t do it. Also, if you decide to do the scan, you could always uninstall Nmap after you are done.)
You can now scan the Windows 7 LPD port by issuing the command below (substitute the static address of your Windows 7 machine, if it is different):
[root@yourcomputername yourusername]# nmap -p 515 192.168.1.2
This command prompts Nmap to connect to your Windows 7 machine at 192.168.1.2, and scan port 515. It will then report the results of the scan, as shown in Figure 5 below. I have obscured my MAC address for security reasons, but you can see clearly that Nmap did connect to the printer port. You are now ready to add the Windows 7 printer.
In Fedora 17, you’ll go to Applications >> Other >> Printing. You’ll get a pop-up windows similar to Figure 6 below (I’ve already added my printer in Figure 6). You’ll click on the +Add button to add your Windows 7 printer. You’ll get a new pop-up window. Select Network Printer >> LPD/LPR Host or Printer. You’ll type in the IP address of your Windows 7 machine in the Host box, and the name of your printer in the Queue box. When you hit Forward, your GNU/Linux machine will start searching for drivers for your printer. It will return a Choose Driver dialog box. You’ll leave the choice as Select printer from database, and you’ll go in and find your printer manufacturer. Hit Forward. You’ll choose your model, and select the recommended driver, if not already selected. Hit Forward. If any other options such as duplex printer come up, hit what option(s) you want supported, and hit Forward again. The final dialog box that you come to should be Describe Printer. Put in all of your printer’s details that you want, and hit Apply. You will be asked for your administrative password. When you enter it, you will be asked if you want to print a test page. Hit Print Test Page,and you should get a beautifully printed CUPS test page full of colors and patterns.