Tuesday, February 01, 2005

Sharing a LAN USB printer across WinXP & Linux

My scenario is that I wanted to share a USB printer with 3 Pcs (2 x Linux and 1 x Windows).

The USB printer is a Lexmark X125 (not the best on the market) and is designed for Windows. I managed to locate and install the equivalent driver for the Linux machines.

Due to having 2 drivers in use, I control which one to use via a Belkin switch. The Windows side was pretty straightforward and didn't involve any configuration.

With Linux I did the following:

1) On the machine with the USB connection (i.e. the one with the printer attached via the switch) I simply set the Printer Configuration as being 'local' to the machine.
By the way, in the first instance I needed to issue the command:-
mknod /dev/usb/lp0 c 180 0 (more info at http://www.linux-usb.org/USB-guide)

2) On the second linux machine, I edited the .profile to include:-
PRINTER=lexmark@192.168.0.3 (as in my case). This saves having to issue the IP address each time, and allows printing from Mozilla too.

That's it! No formal printer configuration needed on the second linux machine. Please feel free to add any comments. Is there a better way?

I have now achieved the basic set-up for my LAN. My next task is to do some exciting work on my Linux servers, such as configuring Tomcat and Oracle servers.

Friday, January 21, 2005

Networking Linux with Windows

I recently acquired 2 redundant PCs and promptly installed RedHat Linux 8.0.

My first task was to network both PCs with my existing Windows XP machine (connected to Broadband). After 1 week of trying, and with help from a few forums, I have cracked it. Before I completely forget, here are the instructions (assuming the network cards are in place).

1) On the Windows XP machine, set up Internet Connection sharing (ICS).
2) The following is for the Linux machines (as root user):
a) Enable FTP permissions by changing disable=yes to disable=no in the file:
/etc/xinetd.d/vsftpd
b) In the file, /etc/sysconfig/network add the line GATEWAYDEV="eth0"
c) In the file, /etc/resolv.conf add the line:
nameserver 192.168.0.1 #this is the WinXP gateway IP
d) Open Network Configuration Tool and, for each machine, type in the IP settings, e.g.-
linux machine 1 ----> 192.168.0.2
255.255.255.0
192.168.0.1

linux machine 2 ----> 192.168.0.3
255.255.255.0
192.168.0.1
e) Reboot linux machines

N.B. When logging both linux machines back in, use the local user (not root) as Ftp is disabled for root user by default. Browsing should now also be possible.

My next Task will be sharing a USB printer on the network.